1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getProjectHooks
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.getProjectHooks

Explore with Pulumi AI

GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

The gitlab.getProjectHooks data source allows to retrieve details about hooks 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 examples = example.then(example => gitlab.getProjectHooks({
    project: example.id,
}));
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_project(id="foo/bar/baz")
examples = gitlab.get_project_hooks(project=example.id)
Copy
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.GetProjectHooks(ctx, &gitlab.GetProjectHooksArgs{
			Project: example.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 examples = GitLab.GetProjectHooks.Invoke(new()
    {
        Project = example.Apply(getProjectResult => getProjectResult.Id),
    });

});
Copy
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.GetProjectHooksArgs;
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 examples = GitlabFunctions.getProjectHooks(GetProjectHooksArgs.builder()
            .project(example.applyValue(getProjectResult -> getProjectResult.id()))
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gitlab:getProject
      arguments:
        id: foo/bar/baz
  examples:
    fn::invoke:
      function: gitlab:getProjectHooks
      arguments:
        project: ${example.id}
Copy

Using getProjectHooks

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getProjectHooks(args: GetProjectHooksArgs, opts?: InvokeOptions): Promise<GetProjectHooksResult>
function getProjectHooksOutput(args: GetProjectHooksOutputArgs, opts?: InvokeOptions): Output<GetProjectHooksResult>
Copy
def get_project_hooks(project: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetProjectHooksResult
def get_project_hooks_output(project: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetProjectHooksResult]
Copy
func GetProjectHooks(ctx *Context, args *GetProjectHooksArgs, opts ...InvokeOption) (*GetProjectHooksResult, error)
func GetProjectHooksOutput(ctx *Context, args *GetProjectHooksOutputArgs, opts ...InvokeOption) GetProjectHooksResultOutput
Copy

> Note: This function is named GetProjectHooks in the Go SDK.

public static class GetProjectHooks 
{
    public static Task<GetProjectHooksResult> InvokeAsync(GetProjectHooksArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectHooksResult> Invoke(GetProjectHooksInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProjectHooksResult> getProjectHooks(GetProjectHooksArgs args, InvokeOptions options)
public static Output<GetProjectHooksResult> getProjectHooks(GetProjectHooksArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getProjectHooks:getProjectHooks
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Project This property is required. string
The name or id of the project.
Project This property is required. string
The name or id of the project.
project This property is required. String
The name or id of the project.
project This property is required. string
The name or id of the project.
project This property is required. str
The name or id of the project.
project This property is required. String
The name or id of the project.

getProjectHooks Result

The following output properties are available:

Hooks List<Pulumi.GitLab.Outputs.GetProjectHooksHook>
The list of hooks.
Id string
The provider-assigned unique ID for this managed resource.
Project string
The name or id of the project.
Hooks []GetProjectHooksHook
The list of hooks.
Id string
The provider-assigned unique ID for this managed resource.
Project string
The name or id of the project.
hooks List<GetProjectHooksHook>
The list of hooks.
id String
The provider-assigned unique ID for this managed resource.
project String
The name or id of the project.
hooks GetProjectHooksHook[]
The list of hooks.
id string
The provider-assigned unique ID for this managed resource.
project string
The name or id of the project.
hooks Sequence[GetProjectHooksHook]
The list of hooks.
id str
The provider-assigned unique ID for this managed resource.
project str
The name or id of the project.
hooks List<Property Map>
The list of hooks.
id String
The provider-assigned unique ID for this managed resource.
project String
The name or id of the project.

Supporting Types

GetProjectHooksHook

ConfidentialIssuesEvents This property is required. bool
Invoke the hook for confidential issues events.
ConfidentialNoteEvents This property is required. bool
Invoke the hook for confidential notes events.
CustomWebhookTemplate This property is required. string
Set a custom webhook template.
DeploymentEvents This property is required. bool
Invoke the hook for deployment events.
EnableSslVerification This property is required. bool
Enable ssl verification when invoking the hook.
HookId This property is required. int
The id of the project hook.
IssuesEvents This property is required. bool
Invoke the hook for issues events.
JobEvents This property is required. bool
Invoke the hook for job events.
MergeRequestsEvents This property is required. bool
Invoke the hook for merge requests.
NoteEvents This property is required. bool
Invoke the hook for notes events.
PipelineEvents This property is required. bool
Invoke the hook for pipeline events.
Project This property is required. string
The name or id of the project to add the hook to.
ProjectId This property is required. int
The id of the project for the hook.
PushEvents This property is required. bool
Invoke the hook for push events.
PushEventsBranchFilter This property is required. string
Invoke the hook for push events on matching branches only.
ReleasesEvents This property is required. bool
Invoke the hook for releases events.
TagPushEvents This property is required. bool
Invoke the hook for tag push events.
Token This property is required. string
A token to present when invoking the hook. The token is not available for imported resources.
Url This property is required. string
The url of the hook to invoke.
WikiPageEvents This property is required. bool
Invoke the hook for wiki page events.
ConfidentialIssuesEvents This property is required. bool
Invoke the hook for confidential issues events.
ConfidentialNoteEvents This property is required. bool
Invoke the hook for confidential notes events.
CustomWebhookTemplate This property is required. string
Set a custom webhook template.
DeploymentEvents This property is required. bool
Invoke the hook for deployment events.
EnableSslVerification This property is required. bool
Enable ssl verification when invoking the hook.
HookId This property is required. int
The id of the project hook.
IssuesEvents This property is required. bool
Invoke the hook for issues events.
JobEvents This property is required. bool
Invoke the hook for job events.
MergeRequestsEvents This property is required. bool
Invoke the hook for merge requests.
NoteEvents This property is required. bool
Invoke the hook for notes events.
PipelineEvents This property is required. bool
Invoke the hook for pipeline events.
Project This property is required. string
The name or id of the project to add the hook to.
ProjectId This property is required. int
The id of the project for the hook.
PushEvents This property is required. bool
Invoke the hook for push events.
PushEventsBranchFilter This property is required. string
Invoke the hook for push events on matching branches only.
ReleasesEvents This property is required. bool
Invoke the hook for releases events.
TagPushEvents This property is required. bool
Invoke the hook for tag push events.
Token This property is required. string
A token to present when invoking the hook. The token is not available for imported resources.
Url This property is required. string
The url of the hook to invoke.
WikiPageEvents This property is required. bool
Invoke the hook for wiki page events.
confidentialIssuesEvents This property is required. Boolean
Invoke the hook for confidential issues events.
confidentialNoteEvents This property is required. Boolean
Invoke the hook for confidential notes events.
customWebhookTemplate This property is required. String
Set a custom webhook template.
deploymentEvents This property is required. Boolean
Invoke the hook for deployment events.
enableSslVerification This property is required. Boolean
Enable ssl verification when invoking the hook.
hookId This property is required. Integer
The id of the project hook.
issuesEvents This property is required. Boolean
Invoke the hook for issues events.
jobEvents This property is required. Boolean
Invoke the hook for job events.
mergeRequestsEvents This property is required. Boolean
Invoke the hook for merge requests.
noteEvents This property is required. Boolean
Invoke the hook for notes events.
pipelineEvents This property is required. Boolean
Invoke the hook for pipeline events.
project This property is required. String
The name or id of the project to add the hook to.
projectId This property is required. Integer
The id of the project for the hook.
pushEvents This property is required. Boolean
Invoke the hook for push events.
pushEventsBranchFilter This property is required. String
Invoke the hook for push events on matching branches only.
releasesEvents This property is required. Boolean
Invoke the hook for releases events.
tagPushEvents This property is required. Boolean
Invoke the hook for tag push events.
token This property is required. String
A token to present when invoking the hook. The token is not available for imported resources.
url This property is required. String
The url of the hook to invoke.
wikiPageEvents This property is required. Boolean
Invoke the hook for wiki page events.
confidentialIssuesEvents This property is required. boolean
Invoke the hook for confidential issues events.
confidentialNoteEvents This property is required. boolean
Invoke the hook for confidential notes events.
customWebhookTemplate This property is required. string
Set a custom webhook template.
deploymentEvents This property is required. boolean
Invoke the hook for deployment events.
enableSslVerification This property is required. boolean
Enable ssl verification when invoking the hook.
hookId This property is required. number
The id of the project hook.
issuesEvents This property is required. boolean
Invoke the hook for issues events.
jobEvents This property is required. boolean
Invoke the hook for job events.
mergeRequestsEvents This property is required. boolean
Invoke the hook for merge requests.
noteEvents This property is required. boolean
Invoke the hook for notes events.
pipelineEvents This property is required. boolean
Invoke the hook for pipeline events.
project This property is required. string
The name or id of the project to add the hook to.
projectId This property is required. number
The id of the project for the hook.
pushEvents This property is required. boolean
Invoke the hook for push events.
pushEventsBranchFilter This property is required. string
Invoke the hook for push events on matching branches only.
releasesEvents This property is required. boolean
Invoke the hook for releases events.
tagPushEvents This property is required. boolean
Invoke the hook for tag push events.
token This property is required. string
A token to present when invoking the hook. The token is not available for imported resources.
url This property is required. string
The url of the hook to invoke.
wikiPageEvents This property is required. boolean
Invoke the hook for wiki page events.
confidential_issues_events This property is required. bool
Invoke the hook for confidential issues events.
confidential_note_events This property is required. bool
Invoke the hook for confidential notes events.
custom_webhook_template This property is required. str
Set a custom webhook template.
deployment_events This property is required. bool
Invoke the hook for deployment events.
enable_ssl_verification This property is required. bool
Enable ssl verification when invoking the hook.
hook_id This property is required. int
The id of the project hook.
issues_events This property is required. bool
Invoke the hook for issues events.
job_events This property is required. bool
Invoke the hook for job events.
merge_requests_events This property is required. bool
Invoke the hook for merge requests.
note_events This property is required. bool
Invoke the hook for notes events.
pipeline_events This property is required. bool
Invoke the hook for pipeline events.
project This property is required. str
The name or id of the project to add the hook to.
project_id This property is required. int
The id of the project for the hook.
push_events This property is required. bool
Invoke the hook for push events.
push_events_branch_filter This property is required. str
Invoke the hook for push events on matching branches only.
releases_events This property is required. bool
Invoke the hook for releases events.
tag_push_events This property is required. bool
Invoke the hook for tag push events.
token This property is required. str
A token to present when invoking the hook. The token is not available for imported resources.
url This property is required. str
The url of the hook to invoke.
wiki_page_events This property is required. bool
Invoke the hook for wiki page events.
confidentialIssuesEvents This property is required. Boolean
Invoke the hook for confidential issues events.
confidentialNoteEvents This property is required. Boolean
Invoke the hook for confidential notes events.
customWebhookTemplate This property is required. String
Set a custom webhook template.
deploymentEvents This property is required. Boolean
Invoke the hook for deployment events.
enableSslVerification This property is required. Boolean
Enable ssl verification when invoking the hook.
hookId This property is required. Number
The id of the project hook.
issuesEvents This property is required. Boolean
Invoke the hook for issues events.
jobEvents This property is required. Boolean
Invoke the hook for job events.
mergeRequestsEvents This property is required. Boolean
Invoke the hook for merge requests.
noteEvents This property is required. Boolean
Invoke the hook for notes events.
pipelineEvents This property is required. Boolean
Invoke the hook for pipeline events.
project This property is required. String
The name or id of the project to add the hook to.
projectId This property is required. Number
The id of the project for the hook.
pushEvents This property is required. Boolean
Invoke the hook for push events.
pushEventsBranchFilter This property is required. String
Invoke the hook for push events on matching branches only.
releasesEvents This property is required. Boolean
Invoke the hook for releases events.
tagPushEvents This property is required. Boolean
Invoke the hook for tag push events.
token This property is required. String
A token to present when invoking the hook. The token is not available for imported resources.
url This property is required. String
The url of the hook to invoke.
wikiPageEvents This property is required. Boolean
Invoke the hook for wiki page events.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi