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 example = gitlab.getProject({
id: "foo/bar/baz",
});
const exampleGetProjectHook = example.then(example => gitlab.getProjectHook({
project: example.id,
hookId: 1,
}));
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.get_project(id="foo/bar/baz")
example_get_project_hook = gitlab.get_project_hook(project=example.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 example = GitLab.GetProject.Invoke(new()
{
Id = "foo/bar/baz",
});
var exampleGetProjectHook = GitLab.GetProjectHook.Invoke(new()
{
Project = example.Apply(getProjectResult => getProjectResult.Id),
HookId = 1,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, 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: example.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 example = GitlabFunctions.getProject(GetProjectArgs.builder()
.id("foo/bar/baz")
.build());
final var exampleGetProjectHook = GitlabFunctions.getProjectHook(GetProjectHookArgs.builder()
.project(example.applyValue(getProjectResult -> getProjectResult.id()))
.hookId(1)
.build());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: gitlab:getProject
arguments:
id: foo/bar/baz
exampleGetProjectHook:
fn::invoke:
function: gitlab:getProjectHook
arguments:
project: ${example.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.