Skip to main content

Update an Existing Collection

PUT 

/api/v33.01/collections/:id

x-prisma-cloud-target-env: {"permission":"collections"}

Updates the parameters for a specific collection.

To invoke this endpoint in the Console UI:

  1. Navigate to Manage > Collections and Tags > Collections.
  2. Click the dotted icon under the Actions column to open up the menu options. Note: The default collections do not have a dotted icon in the Actions column. Use the Manage cog icon to open the update window.
  3. Click the Manage button and update the collection's parameters.
  4. Click the Save button to save the changes.

cURL Request

The PUT cURL command updates a collection.

To submit a cURL request:

  • The name value is required.
  • If description is not included in the request, the value will be defaulted to an empty string.
  • If color is not included in the request, the system will set the color to a random value.
  • If one of the following resources is left unspecified, the resource value will be set to a wildcard [*]: hosts, images, labels, containers, functions, namespaces, appIDs, accountIDs, codeRepos, clusters

Example cURL Request

This existing collection my-collection captures all container images named ubuntu:18.04.

{
"hosts":["*"],
"images":["ubuntu:18.04"],
"labels":["*"],
"containers":["*"],
"functions":["*"],
"namespaces":["*"],
"appIDs":["*"],
"accountIDs":["*"],
"codeRepos":["*"],
"clusters":["*"],
"name":"my-collection",
"owner":"<OWNER_NAME>",
"modified":"2021-01-01T21:04:30.417Z",
"color":"#AD3C21",
"system":"false"
}

The following cURL command updates my-collection to captures all container images named ubuntu:20.04.

Note: You can retrieve collection names from the GET /api/v<VERSION>/collections endpoint using the name key.

Refer to the following example cURL command:

$ curl 'https://<CONSOLE>/api/v<VERSION>/collections/my-collection' \
-k \
-X PUT \
-u <USER> \
-H 'Content-Type: application/json' \
-d \
'{
"name":"my-collection",
"images":["ubuntu:20.04"]
}'

Note: No response will be returned upon successful execution.

Request

Path Parameters

    id stringrequired

Body

    accountIDs string (string)[]

    List of account IDs.

    appIDs string (string)[]

    List of application IDs.

    clusters string (string)[]

    List of Kubernetes cluster names.

    color common.Color (string)

    Color is a hexadecimal representation of color code value

    containers string (string)[]

    List of containers.

    description string

    Free-form text.

    functions string (string)[]

    List of functions.

    hosts string (string)[]

    List of hosts.

    images string (string)[]

    List of images.

    labels string (string)[]

    List of labels.

    modified date-time

    Datetime when the collection was last modified.

    name string

    Collection name. Must be unique.

    namespaces string (string)[]

    List of Kubernetes namespaces.

    owner string

    User who created or last modified the collection.

    prisma boolean

    Indicates whether this collection originates from Prisma Cloud.

    system boolean

    Indicates whether this collection was created by the system (i.e., a non user) (true) or a real user (false).

Responses

OK

Loading...