getProjectHook

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,
}));
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)
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,
});
});
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
})
}
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());
}
}
variables:
exampleProject:
fn::invoke:
Function: gitlab:getProject
Arguments:
id: foo/bar/baz
exampleProjectHook:
fn::invoke:
Function: gitlab:getProjectHook
Arguments:
project: ${exampleProject.id}
hookId: 1

Return

A collection of values returned by getProjectHook.

Parameters

argument

A collection of arguments for invoking getProjectHook.


suspend fun getProjectHook(hookId: Int, project: String): GetProjectHookResult

Return

A collection of values returned by getProjectHook.

Parameters

hookId

The id of the project hook.

project

The name or id of the project to add the hook to.

See also


Return

A collection of values returned by getProjectHook.

Parameters

argument

Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectHookPlainArgs.

See also