ALM (v3)
This API is already deprecated.
Endpoint
https://api.mobingi.comOAuth Authentication
In order to interact with the API, your application must authenticate. Mobingi API handles this through OAuth. An OAuth token functions as a complete authentication request. In effect, it acts as a substitute for a username and password pair.
To get an OAuth token, make a POST request to
POST /v3/access_token
Parameters
Type
Required
Detail
client_id
string
Yes
client_secret
string
Yes
grant_type
string
Yes
This value is either client_credentials or password. If you grant with password, you are interacting the same as working around Mobingi UI; If you grant with client_credentials, you are acting as an Alm-Agent, and most resource related permissions are denied by RBAC.
Example Request:
curl -X POST https://api.mobingi.com/v3/access_token \
-H "Content-Type: application/json" \
-d '{"grant_type":"client_credentials","client_id":"lg-5447820c870e1-xBV0OpTEN-tm","client_secret":"sFVYDoe07fxPjNgYvauYGOYCeXbOTE"}'Response Body:
{
"token_type": "Bearer",
"expires_in": 43200,
"access_token": "eyJ0eXAiOiJQiLCJhbGciOMeXzQfME"
}You can then start making API requests by passing the access_token value to the Authorization Header
ALM Templates
Apply Template
Applies the Mobingi Alm template and creates stack.
POST /v3/alm/template
Parameters
Type
Required
Detail
{ template body }
string
Yes
Mobingi Alm template body in json string format
Request Header
Request body
Response Body
Update Template
Updates the Mobingi Alm template and applies the changes to stack resources.
Note: vendor section will be ignored when performing this API call. You can not change cloud vendors after the stack is created.
PUT /v3/alm/template/{stack_id}
Parameters
Type
Required
Detail
{ template body }
string
Yes
Mobingi Alm template body in json string format
Request Header
Request body
Response Body
Compare Templates
Compares the resource changes between two Mobingi Alm templates.
POST /v3/alm/template/compare
Parameters
Type
Required
Detail
id
array
conditional
items contain stack id and version information
body
array
conditional
items contain template body source
Note: You can compare two templates by retrieving them from their version id and stack id. Or, you can compare a target template body (posted in json format to body parameter) with a source template retrieved by its version id and stack id.
The current API version only supports two templates comparison, and you always should retrieve the source template by its version id and stack id. That being said, you have to always pass at least one item in parameter id array. Below are two examples:
Request Header
Request body ( Example 1 )
Request body ( Example 2 )
Response Body
Template Versions
List Mobingi Alm template versions
GET /v3/alm/template
Parameters
Type
Required
Detail
stack_id
string
Yes
The unique id returned when applying the template
Request Header
Response Body
Describe Template
Describes the template body of a specific version.
GET /v3/alm/template/{stack_id}
Parameters
Type
Required
Detail
version_id
string
No
The id of the template version associated with the stack. If empty or "latest" provided, the most updated template version is returned
Request Header
Response Body
Stacks
List Stacks
List all stacks running under current organization account.
GET /v3/alm/stack
Request Header
Response Body
Describe Stack
Describes the stack detail information.
GET /v3/alm/stack/{stack_id}
Request Header
Response Body
Describe Container
Describes the stack container detail information.
GET /v3/alm/container/{container_id}
Parameters
Type
Required
Detail
container_id
string
Yes
The id of the container associated with the stack.
Request Header
Response Body
List Containers
List the stack containers filtering by {stack_id} or {instance_id}
GET /v3/alm/container
Parameters
Type
Required
Detail
stack_id
string
conditional
If both {stack_id} and {instance_id} are presents, {stack_id} will be ignored.
instance_id
string
conditional
The id of the instance.
Request Header
Response Body
RBAC
Create Role
Creates a new role. (Note: This endpoint can only be accessed by master account)
POST /v3/role
Parameters
Type
Required
Detail
name
string
Yes
Name of Mobingi Role
scope
string
Yes
Mobingi Role in json string format
Request Header
Request body
Response Body
Update Role
Updates an existing role.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
PUT /v3/role/{role_id}
Parameters
Type
Required
Detail
name
string
Yes
Name of Mobingi Role
scope
string
Yes
Mobingi Role in json string format
Request Header
Request body
Response Body
Delete Role
Deletes an existing Role.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
DELETE /v3/role/{role_id}
Request Header
Response Body
List Roles
Lists all roles created under current account.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
GET /v3/role
Request Header
Response Body
Describe Roles
Describe roles attached to the user
Lists all roles attached to a user specified by username.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
GET
/v3/user/{username}/role
Response Body
Response Body
Request body
Response Body
Reattach Role to User
Reattach a role to user.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
PUT /v3/user/role/{role_id}
Parameters
Type
Required
Detail
username
string
Yes
target user
Request Header
Request body
Response Body
Detach Role from User
Deatch a role from user.
Note: This endpoint is denied to all users except master account, defined by default RBAC scope, and this scope cannot be overwritten.
DELETE /v3/user/role/{role_id}
Parameters
Type
Required
Detail
username
string
Yes
target user
Request Header
Request body
Response Body
Describe Role Scope
Describes the role scope body.
GET /v3/role/templates
Request Header
Response Body
Alm-Agent
In this section, all endpoints are designated to work with Mobingi alm-agent in order to perform application lifecycle automation by Mobingi. Mobingi alm-agent is the Linux server side program that automatically installed during instance launch and initialization. If you are a contributor to the OSS repo github.com/mobingi/alm-agent, you're looking at the right reference here. If you are a developer working on integrating Mobingi ALM with your client applications or contributing to Mobingi API/UI only, you can ignore this API references section.
Register Agent Status
This endpoint listens to the notifications sent by Mobingi alm-agent for self status registration.
For example, when an instance is launched and Mobingi alm agent is installed, the agent will first call this endpoint to register itself.
Another example, when an AWS spot instance is scheduled to be shutdown, the agent will send notice to this endpoint and allow Mobingi system to perform other necessary actions (such as spot replacement).
POST /v3/alm/agent/agent_status
Parameters
Type
Required
Detail
stack_id
string
Yes
The stack id which this server instance is belonged to
agent_id
string
Yes
The agent's unique identifier
status
string
Yes
Sample values: starting, installing, error, notice, spot_terminate, etc..
instance_id
string
No
The server instance id where Mobingi alm-agent is installed on
message
string
No
Optional, a description of the status message, e.g: image/repository not found
Request Header
Response Body
Register Container Status
This endpoint listens to the notifications sent by Mobingi alm-agent with the status updates during a container's lifecycle. Possible status examples: starting, updating, restarting, running, terminated, etc.
POST /v3/alm/agent/container_status
Parameters
Type
Required
Detail
stack_id
string
Yes
The stack id which this server instance is belonged to
agent_id
string
Yes
The agent's unique identifier
container_id
string
Yes
The container unique id. _Sometimes, this value could be an instance's id.
status
string
Yes
sample values: starting, updating, restarting, running, terminated, etc..
instance_id
string
No
The server instance id where Mobingi alm-agent is installed on
Request Header
Response Body
Describe Container Configuration
This endpoint is used by Mobingi alm-agent to describing container section of the layer configuration from Mobingi Alm Template, identified by flag name.
GET /v3/alm/agent/config
Parameters
Type
Required
Detail
stack_id
string
Yes
the stack id where the instance is associated to
flag
string
Yes
The flag identifier of the configuration layer
Request Header
Response Body
Note: If the response has an empty body, it could mean that wrong flag name was provided, or it doesn't have any container config defined.
Last updated
Was this helpful?