Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • the Scaling methods of the Lifecycle HTTP RESTful APIMicroservices;

  • the Get/Set Commands of the Command Line Interface; or

  • the ProgramClient API of the Java Client API.

The examples given below use the Lifecycle HTTP RESTful APIMicroservices.

Scaling Services

You can query or change the number of instances of a service by using the instances parameter with HTTP GET or PUT methods:

...

Note: You can scale system services using the Monitor HTTP RESTful API Scaling Microservices Scaling System Services.

Examples

  • Retrieve the number of instances of the service CatalogLookup in the application PurchaseHistory in the namespace default:

    Code Block
    GET /v3/namespaces/default/apps/PurchaseHistory/services/CatalogLookup/instances
  • Set the number of handler instances of the service RetrieveCounts of the application WordCount:

    Code Block
    PUT /v3/namespaces/default/apps/WordCount/services/RetrieveCounts/instances

    with the arguments as a JSON string in the body:

    Code Block
    { "instances" : 2 }
  • Using curl and the CDAP Sandbox:

...