> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/argoproj/argo-cd/llms.txt
> Use this file to discover all available pages before exploring further.

# ApplicationSet Service

> gRPC API reference for ApplicationSetService - CRUD operations for Argo CD ApplicationSets

# 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`

<ParamField path="name" type="string" required>
  The ApplicationSet's name
</ParamField>

<ParamField path="appsetNamespace" type="string">
  The ApplicationSet namespace. Default empty is argocd control plane namespace
</ParamField>

**Response:** `ApplicationSet`

**REST Endpoint:** `GET /api/v1/applicationsets/{name}`

***

### List

Returns list of applicationsets.

**Request:** `ApplicationSetListQuery`

<ParamField path="projects" type="string[]">
  The project names to restrict returned list applicationsets
</ParamField>

<ParamField path="selector" type="string">
  The selector to restrict returned list to applicationsets only with matched labels
</ParamField>

<ParamField path="appsetNamespace" type="string">
  The ApplicationSet namespace. Default empty is argocd control plane namespace
</ParamField>

**Response:** `ApplicationSetList`

**REST Endpoint:** `GET /api/v1/applicationsets`

***

### Create

Creates an applicationset.

**Request:** `ApplicationSetCreateRequest`

<ParamField path="applicationset" type="ApplicationSet" required>
  The ApplicationSet to create
</ParamField>

<ParamField path="upsert" type="bool">
  Whether to create or update the ApplicationSet if it already exists
</ParamField>

<ParamField path="dryRun" type="bool">
  Whether to perform a dry run
</ParamField>

**Response:** `ApplicationSet`

**REST Endpoint:** `POST /api/v1/applicationsets`

***

### Delete

Deletes an applicationset.

**Request:** `ApplicationSetDeleteRequest`

<ParamField path="name" type="string" required>
  The ApplicationSet's name
</ParamField>

<ParamField path="appsetNamespace" type="string">
  The ApplicationSet namespace. Default empty is argocd control plane namespace
</ParamField>

**Response:** `ApplicationSetResponse`

<ResponseField name="project" type="string">
  The project name
</ResponseField>

<ResponseField name="applicationset" type="ApplicationSet">
  The deleted ApplicationSet
</ResponseField>

**REST Endpoint:** `DELETE /api/v1/applicationsets/{name}`

***

### Generate

Generates applications from an ApplicationSet.

**Request:** `ApplicationSetGenerateRequest`

<ParamField path="applicationSet" type="ApplicationSet" required>
  The ApplicationSet to generate applications from
</ParamField>

**Response:** `ApplicationSetGenerateResponse`

<ResponseField name="applications" type="Application[]">
  The generated applications
</ResponseField>

**REST Endpoint:** `POST /api/v1/applicationsets/generate`

***

### ResourceTree

Returns resource tree for an ApplicationSet.

**Request:** `ApplicationSetTreeQuery`

<ParamField path="name" type="string" required>
  The ApplicationSet's name
</ParamField>

<ParamField path="appsetNamespace" type="string">
  The ApplicationSet namespace. Default empty is argocd control plane namespace
</ParamField>

**Response:** `ApplicationSetTree`

**REST Endpoint:** `GET /api/v1/applicationsets/{name}/resource-tree`

***

### ListResourceEvents

Returns a list of event resources for an ApplicationSet.

**Request:** `ApplicationSetGetQuery`

<ParamField path="name" type="string" required>
  The ApplicationSet's name
</ParamField>

<ParamField path="appsetNamespace" type="string">
  The ApplicationSet namespace. Default empty is argocd control plane namespace
</ParamField>

**Response:** `EventList`

**REST Endpoint:** `GET /api/v1/applicationsets/{name}/events`

***

### Watch

Returns stream of applicationset change events.

**Request:** `ApplicationSetWatchQuery`

<ParamField path="name" type="string">
  The ApplicationSet's name to watch
</ParamField>

<ParamField path="projects" type="string[]">
  The project names to filter by
</ParamField>

<ParamField path="selector" type="string">
  The selector to filter by labels
</ParamField>

<ParamField path="appSetNamespace" type="string">
  The ApplicationSet namespace
</ParamField>

<ParamField path="resourceVersion" type="string">
  When specified with a watch call, shows changes that occur after that particular version of a resource
</ParamField>

**Response:** Stream of `ApplicationSetWatchEvent`

**REST Endpoint:** `GET /api/v1/stream/applicationsets`

***

## gRPC Example

```go theme={null}
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)
}
```
