App Management

Do you manage an elastic infrastructure, or would you rather automate your TraceView deploy? The App Management API is for you.

You can use this API to create and delete apps and to add hosts to apps.

Assigning Apps

POST /api-v2/assign_app

This endpoint allows you to create a new app or assign a host to an existing app. The specifics of what is and isn’t allowed may differ, depending on the state of the app. See below for examples.

Full list of POST parameters:

Value Description
appname Name of the app to join. Must exist and have at least 1 layer. Note that you cannot join Default, as all hosts start there. App names currently have a maximum length of 40 characters.
hostname Name of the host to assign to the app
layer (optional) Name of the layer to assign to the app.
tags (optional) A comma-separated string of tag names.
create (optional) If present, the API will create the app if it doesn’t exist.

Note: The parameter tags takes a comma-separated string of tag names (with no spaces). For example: tags=development,staging.

Creating a new app, or adding a host to an empty app

To create an app using the API, add the optional create flag. To add a host to an empty app, you must also specify the layer name.

Note that an app can only have one layer name configured via the API. Other layers will be autodiscovered below this layer, so most of the time, this layer is a webserver like “apache”, “nginx”, or “tomcat.”

You can also optionally add tags to the app you are creating. If a tag you specify does not exist, it will be created and added to the app.

$ curl https://api.tv.solarwinds.com/api-v2/assign_app \
    -d key=<access-key> \
    -d hostname=<hostname> \
    -d appname=<appname> \
    -d layer=<layer> \
    -d tags=<tags> \
    -d create=True

{ "response": "ok", "data": True }

Adding a host to an existing app

To add a host to an existing app, you only have to specify the host.

$ curl https://api.tv.solarwinds.com/api-v2/assign_app \
    -d key=<access-key> \
    -d hostname=<hostname> \
    -d appname=<appname>

{ "response": "ok", "data": True }

Deleting Apps

DELETE /api-v2/app/<app_name>

To delete an existing app, you must specify the app name.

Returns True if the app is successfully deleted. Raises an error if no app with the specified name is found.

Sample

$ curl -X DELETE https://api.tv.solarwinds.com/api-v2/app/<app_name> \
    -d key=<access-key>

{ "response": "ok", "data": True }

Note that you can not delete the “Default” app.

Table Of Contents

Related Topics