get Project Hook
The gitlab.ProjectHook
data source allows to retrieve details about a hook in a project. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const exampleProject = gitlab.getProject({
id: "foo/bar/baz",
});
const exampleProjectHook = exampleProject.then(exampleProject => gitlab.getProjectHook({
project: exampleProject.id,
hookId: 1,
}));
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
example_project = gitlab.get_project(id="foo/bar/baz")
example_project_hook = gitlab.get_project_hook(project=example_project.id,
hook_id=1)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var exampleProject = GitLab.GetProject.Invoke(new()
{
Id = "foo/bar/baz",
});
var exampleProjectHook = GitLab.GetProjectHook.Invoke(new()
{
Project = exampleProject.Apply(getProjectResult => getProjectResult.Id),
HookId = 1,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleProject, err := gitlab.LookupProject(ctx, &gitlab.LookupProjectArgs{
Id: pulumi.StringRef("foo/bar/baz"),
}, nil)
if err != nil {
return err
}
_, err = gitlab.LookupProjectHook(ctx, &gitlab.LookupProjectHookArgs{
Project: exampleProject.Id,
HookId: 1,
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetProjectArgs;
import com.pulumi.gitlab.inputs.GetProjectHookArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var exampleProject = GitlabFunctions.getProject(GetProjectArgs.builder()
.id("foo/bar/baz")
.build());
final var exampleProjectHook = GitlabFunctions.getProjectHook(GetProjectHookArgs.builder()
.project(exampleProject.applyValue(getProjectResult -> getProjectResult.id()))
.hookId(1)
.build());
}
}
Content copied to clipboard
variables:
exampleProject:
fn::invoke:
Function: gitlab:getProject
Arguments:
id: foo/bar/baz
exampleProjectHook:
fn::invoke:
Function: gitlab:getProjectHook
Arguments:
project: ${exampleProject.id}
hookId: 1
Content copied to clipboard
Return
A collection of values returned by getProjectHook.
Parameters
argument
A collection of arguments for invoking getProjectHook.
Return
A collection of values returned by getProjectHook.
Parameters
hook Id
The id of the project hook.
project
The name or id of the project to add the hook to.
See also
suspend fun getProjectHook(argument: suspend GetProjectHookPlainArgsBuilder.() -> Unit): GetProjectHookResult
Return
A collection of values returned by getProjectHook.
Parameters
argument
Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectHookPlainArgs.