1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getClusterAgents
GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi

gitlab.getClusterAgents

Explore with Pulumi AI

GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi

The gitlab.getClusterAgents data source allows details of GitLab Agents for Kubernetes in a project.

Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const agents = gitlab.getClusterAgents({
    project: "12345",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

agents = gitlab.get_cluster_agents(project="12345")
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 {
		_, err := gitlab.GetClusterAgents(ctx, &gitlab.GetClusterAgentsArgs{
			Project: "12345",
		}, 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 agents = GitLab.GetClusterAgents.Invoke(new()
    {
        Project = "12345",
    });

});
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.GetClusterAgentsArgs;
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 agents = GitlabFunctions.getClusterAgents(GetClusterAgentsArgs.builder()
            .project("12345")
            .build());

    }
}
Copy
variables:
  agents:
    fn::invoke:
      function: gitlab:getClusterAgents
      arguments:
        project: '12345'
Copy

Using getClusterAgents

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 getClusterAgents(args: GetClusterAgentsArgs, opts?: InvokeOptions): Promise<GetClusterAgentsResult>
function getClusterAgentsOutput(args: GetClusterAgentsOutputArgs, opts?: InvokeOptions): Output<GetClusterAgentsResult>
Copy
def get_cluster_agents(project: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetClusterAgentsResult
def get_cluster_agents_output(project: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetClusterAgentsResult]
Copy
func GetClusterAgents(ctx *Context, args *GetClusterAgentsArgs, opts ...InvokeOption) (*GetClusterAgentsResult, error)
func GetClusterAgentsOutput(ctx *Context, args *GetClusterAgentsOutputArgs, opts ...InvokeOption) GetClusterAgentsResultOutput
Copy

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

public static class GetClusterAgents 
{
    public static Task<GetClusterAgentsResult> InvokeAsync(GetClusterAgentsArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterAgentsResult> Invoke(GetClusterAgentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetClusterAgentsResult> getClusterAgents(GetClusterAgentsArgs args, InvokeOptions options)
public static Output<GetClusterAgentsResult> getClusterAgents(GetClusterAgentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getClusterAgents:getClusterAgents
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Project This property is required. string
The ID or full path of the project owned by the authenticated user.
Project This property is required. string
The ID or full path of the project owned by the authenticated user.
project This property is required. String
The ID or full path of the project owned by the authenticated user.
project This property is required. string
The ID or full path of the project owned by the authenticated user.
project This property is required. str
The ID or full path of the project owned by the authenticated user.
project This property is required. String
The ID or full path of the project owned by the authenticated user.

getClusterAgents Result

The following output properties are available:

ClusterAgents List<Pulumi.GitLab.Outputs.GetClusterAgentsClusterAgent>
List of the registered agents.
Id string
The provider-assigned unique ID for this managed resource.
Project string
The ID or full path of the project owned by the authenticated user.
ClusterAgents []GetClusterAgentsClusterAgent
List of the registered agents.
Id string
The provider-assigned unique ID for this managed resource.
Project string
The ID or full path of the project owned by the authenticated user.
clusterAgents List<GetClusterAgentsClusterAgent>
List of the registered agents.
id String
The provider-assigned unique ID for this managed resource.
project String
The ID or full path of the project owned by the authenticated user.
clusterAgents GetClusterAgentsClusterAgent[]
List of the registered agents.
id string
The provider-assigned unique ID for this managed resource.
project string
The ID or full path of the project owned by the authenticated user.
cluster_agents Sequence[GetClusterAgentsClusterAgent]
List of the registered agents.
id str
The provider-assigned unique ID for this managed resource.
project str
The ID or full path of the project owned by the authenticated user.
clusterAgents List<Property Map>
List of the registered agents.
id String
The provider-assigned unique ID for this managed resource.
project String
The ID or full path of the project owned by the authenticated user.

Supporting Types

GetClusterAgentsClusterAgent

AgentId This property is required. int
The ID of the agent.
CreatedAt This property is required. string
The ISO8601 datetime when the agent was created.
CreatedByUserId This property is required. int
The ID of the user who created the agent.
Name This property is required. string
The Name of the agent.
Project This property is required. string
ID or full path of the project maintained by the authenticated user.
AgentId This property is required. int
The ID of the agent.
CreatedAt This property is required. string
The ISO8601 datetime when the agent was created.
CreatedByUserId This property is required. int
The ID of the user who created the agent.
Name This property is required. string
The Name of the agent.
Project This property is required. string
ID or full path of the project maintained by the authenticated user.
agentId This property is required. Integer
The ID of the agent.
createdAt This property is required. String
The ISO8601 datetime when the agent was created.
createdByUserId This property is required. Integer
The ID of the user who created the agent.
name This property is required. String
The Name of the agent.
project This property is required. String
ID or full path of the project maintained by the authenticated user.
agentId This property is required. number
The ID of the agent.
createdAt This property is required. string
The ISO8601 datetime when the agent was created.
createdByUserId This property is required. number
The ID of the user who created the agent.
name This property is required. string
The Name of the agent.
project This property is required. string
ID or full path of the project maintained by the authenticated user.
agent_id This property is required. int
The ID of the agent.
created_at This property is required. str
The ISO8601 datetime when the agent was created.
created_by_user_id This property is required. int
The ID of the user who created the agent.
name This property is required. str
The Name of the agent.
project This property is required. str
ID or full path of the project maintained by the authenticated user.
agentId This property is required. Number
The ID of the agent.
createdAt This property is required. String
The ISO8601 datetime when the agent was created.
createdByUserId This property is required. Number
The ID of the user who created the agent.
name This property is required. String
The Name of the agent.
project This property is required. String
ID or full path of the project maintained by the authenticated user.

Package Details

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