Skip to main content

ApplicationSet Service

ApplicationSet Service API performs CRUD actions against applicationset resources.

Service Definition

Package: applicationset Service: ApplicationSetService The ApplicationSetService manages ApplicationSets, which generate multiple Argo CD applications from a single template.

RPC Methods

Get

Returns an applicationset by name. Request: ApplicationSetGetQuery
name
string
required
The ApplicationSet’s name
appsetNamespace
string
The ApplicationSet namespace. Default empty is argocd control plane namespace
Response: ApplicationSet REST Endpoint: GET /api/v1/applicationsets/{name}

List

Returns list of applicationsets. Request: ApplicationSetListQuery
projects
string[]
The project names to restrict returned list applicationsets
selector
string
The selector to restrict returned list to applicationsets only with matched labels
appsetNamespace
string
The ApplicationSet namespace. Default empty is argocd control plane namespace
Response: ApplicationSetList REST Endpoint: GET /api/v1/applicationsets

Create

Creates an applicationset. Request: ApplicationSetCreateRequest
applicationset
ApplicationSet
required
The ApplicationSet to create
upsert
bool
Whether to create or update the ApplicationSet if it already exists
dryRun
bool
Whether to perform a dry run
Response: ApplicationSet REST Endpoint: POST /api/v1/applicationsets

Delete

Deletes an applicationset. Request: ApplicationSetDeleteRequest
name
string
required
The ApplicationSet’s name
appsetNamespace
string
The ApplicationSet namespace. Default empty is argocd control plane namespace
Response: ApplicationSetResponse
project
string
The project name
applicationset
ApplicationSet
The deleted ApplicationSet
REST Endpoint: DELETE /api/v1/applicationsets/{name}

Generate

Generates applications from an ApplicationSet. Request: ApplicationSetGenerateRequest
applicationSet
ApplicationSet
required
The ApplicationSet to generate applications from
Response: ApplicationSetGenerateResponse
applications
Application[]
The generated applications
REST Endpoint: POST /api/v1/applicationsets/generate

ResourceTree

Returns resource tree for an ApplicationSet. Request: ApplicationSetTreeQuery
name
string
required
The ApplicationSet’s name
appsetNamespace
string
The ApplicationSet namespace. Default empty is argocd control plane namespace
Response: ApplicationSetTree REST Endpoint: GET /api/v1/applicationsets/{name}/resource-tree

ListResourceEvents

Returns a list of event resources for an ApplicationSet. Request: ApplicationSetGetQuery
name
string
required
The ApplicationSet’s name
appsetNamespace
string
The ApplicationSet namespace. Default empty is argocd control plane namespace
Response: EventList REST Endpoint: GET /api/v1/applicationsets/{name}/events

Watch

Returns stream of applicationset change events. Request: ApplicationSetWatchQuery
name
string
The ApplicationSet’s name to watch
projects
string[]
The project names to filter by
selector
string
The selector to filter by labels
appSetNamespace
string
The ApplicationSet namespace
resourceVersion
string
When specified with a watch call, shows changes that occur after that particular version of a resource
Response: Stream of ApplicationSetWatchEvent REST Endpoint: GET /api/v1/stream/applicationsets

gRPC Example

import (
    "context"
    "google.golang.org/grpc"
    applicationsetpkg "github.com/argoproj/argo-cd/v3/pkg/apiclient/applicationset"
)

// Create a gRPC connection
conn, err := grpc.Dial("argocd-server:443", grpc.WithInsecure())
if err != nil {
    log.Fatal(err)
}
defer conn.Close()

// Create applicationset service client
client := applicationsetpkg.NewApplicationSetServiceClient(conn)

// List applicationsets
appSets, err := client.List(context.Background(), &applicationsetpkg.ApplicationSetListQuery{
    Projects: []string{"default"},
})
if err != nil {
    log.Fatal(err)
}

// Get a specific applicationset
appSet, err := client.Get(context.Background(), &applicationsetpkg.ApplicationSetGetQuery{
    Name: "my-appset",
})
if err != nil {
    log.Fatal(err)
}

// Generate applications from an ApplicationSet
genResp, err := client.Generate(context.Background(), &applicationsetpkg.ApplicationSetGenerateRequest{
    ApplicationSet: appSet,
})
if err != nil {
    log.Fatal(err)
}

for _, app := range genResp.Applications {
    fmt.Printf("Generated app: %s\n", app.Name)
}

Build docs developers (and LLMs) love