Working with Instance Sets

Learn how to use NGINX Management Suite Instance Manager to create Instance Sets, which you can use to group multiple NGINX instances as permission object.


This documentation applies to NGINX Management Suite Instance Manager 2.10.0 and later.


Overview

You can easily manage RBAC permissions for multiple NGINX instances as a single entity by creating an Instance Set in Instance Manager and adding NGINX instances. While Instance Groups are similar to a cluster, as all instances must share the same config, the same is not true with Instance Sets. Instance sets are exclusively an RBAC tool to allow managing a large number of instances as a single item.


Before You Begin

To complete the instructions in this guide, you need the following:

  • An installed version of Instance Manager
  • One or more NGINX data plane instances
  • Knowledge of the Instance Set API
See Also:

You can view the Instance Manager API Reference documentation in the NGINX Management Suite user interface. To access the API Docs, take the steps below:

  1. Log in to the NGINX Management Suite user interface.
  2. From the Launchpad, select the API Documentation card.
  3. Select NIM and Platform API from the Docs list in the sidebar. The API Reference documentation will then display.

Default Set

All instances get added to a default Instance Set when registered. You can use this to set base-level permissions for all new instances that get added to Instance Manager before you add the instance to a more specific set.


Create Instance Sets

See Also:
You can use tools such as curl or Postman to interact with the Instance Manager REST API. The API URL follows the format https://<NMS_FQDN>/api/nim/<API_VERSION> and must include authentication information with each call. For more information about authentication options, please refer to the API Overview.

To create an Instance Set using the REST API, send an HTTP POST request to the Instance Sets endpoint.

Method Endpoint
POST /platform/v1/instance-sets

JSON request
{
  "instances": [
    {
      "uid": "9bad47e6-5ed4-4522-96c0-6f507c2e7198",
      "value": "my instance"
    }
  ],
  "name": "set-1"
}

Add Instances to Instance Sets

You can assign NGINX instances to instance sets in the following ways:

  • (Preferred) Directly add the Instance to the Instance Set with the Direct Add API.
  • Alternatively, you can use the Update Instance Set API PUT /api/platform/v1/instance-sets/{instSetUid}, but this method requires passing all instances that belong in the set with the call.

Use the Direct Add API

The direct add method does not require you to build the entire list of all instances you want in an Instance Set every time you want to add a new instance.

To add an instance to an Instance Set with the Direct Add API, send an HTTP POST request to the Instance Sets endpoint.

Method Endpoint
POST /platform/v1/instance-sets/{instSetUid}/instances/
JSON request
{
  "uid": "9bad47e6-5ed4-4522-96c0-6f507c2e7198",
  "value": "my instance"
}

Updating the Entire Instance Set

To add an instance to an Instance Set by updating the Instance Set:

  1. Get the JSON for the existing Instance Set:

    GET /api/platform/v1/instance-sets/{instSetUid}

  2. Manually add the new instance to the instances list in the JSON.

  3. Update the Instance Set with the updated JSON:

    PUT /api/platform/v1/instance-sets/{instSetUid}


Remove Instances from Instance Sets

To remove an instance from an Instance Set using the REST API, send an HTTP DELETE request to the Instance Sets endpoint.

Method Endpoint
DELETE /platform/v1/instance-sets/{instSetUid}/instances/{instUid}


Delete Instance Sets

To delete an Instance Set using the REST API, send an HTTP DELETE request to the Instance Sets endpoint.

Method Endpoint
DELETE /platform/v1/instance-sets/{instSetUid}


View List of Instance Sets

To view the list of Instance Sets using the REST API, send an HTTP GET request to the Instance Sets endpoint.

Method Endpoint
GET /platform/v1/instance-sets/


View Instances in an Instance Set

To view the instances in an Instance Set using the REST API, send an HTTP GET request to the Instance Sets endpoint.

Method Endpoint
GET /platform/v1/instance-sets/{instSetUid}/instances/