The State of The Amazon EC2 Spot Market is now available! Download The White Paper

Multai API Documentation

Welcome to Multai API Documentation!

Welcome to the heart and soul of Multai: our API, which allows you to manage and operate your Multai account using conventional RESTful API. Whatever you can do via our portal, you can also do via our API.

Except for content explicitly made available to the general public, access and use of this site and all content herein is restricted to users authorized by Spotinst and may be subject to confidentiality restrictions. Please also note that the information contained herein is for informational purposes only and to the extent it conflicts with the terms of your contractual agreements with Spotinst, the terms of those contracts will govern.

Next 


API Semantic

This page explains the semantics of our REST API. It includes information on:

  • How to ask a service about itself: what fields it supports, which fields are filterable

  • How to get only the information you want by filtering and sorting

  • The “shape” of our JSON responses in different scenarios

HTTP Protocol

The Multai API supports HTTP Protocol version 1.1 or later. While some calls may work with the deprecated 1.0 version, this is not guaranteed. Please ensure that your client communicates using at least version 1.1.

API Endpoint

Multai API URL:

https://api.multai.io

Please note - We enforce using the secure endpoint (https) for our production API to ensure the privacy of your data.

REST Semantic

Our API services are RESTful. REST (Representational State Transfer) is a type of software architecture in which requests model the communication from a web browser to a web server. Below are the central REST methods used in our API services, and their uses:

REST Method Use
POST Create
GET Read
PUT Update
DELETE Delete

Projects in Multai

All entities in Multai are part of a project that a user creates. A project is a divider for the user to separate between different departments, different environments(Dev,Prod), etc. For each request you send to the API you must add the project id as a query param.

For example:

https://api.multai.io/loadBalancer/balancer?project=pr-dr23dy5

cURL

In our documentation we use curl to make HTTP requests. Curl is a command-line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, and more. Example scripts have been provided on each API wiki page to illustrate the structure of the curl commands you will need to run Multai API services. In addition, an example of how to a make a genericPOST request is shown below.

$ curl -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer <TOKEN>"
-d @some.jsonfile 'http://api.multai.com/'
Request Parameter Description
-H "Content-Type: " Indicates which type of data you pass, could be "application/json" or "application/x-www-form-urlencoded"
-H "Authorization: Bearer " Retrieves your authentication token
-X The type of the request. in this case "POST"
-d Indicates that you are going to upload a file or a encoded payload
"https://api.multai.io/pr-teg232sew/balancer" End point URL and path for your request

Use Single Quotes Around Your Request URL Some requests require single quotes around your request URL, as in the above curl request. If you get an error message from your UNIX shell, make sure your request URL has single quotes before troubleshooting further. For more information on how UNIX shell quotes and escaping work, see this documentation on quotes and escaping in shells.

JSON Fields Types

POST and PUT requests require JSON data. For PUT requests, only the JSON fields included in a request will be updated. All other fields will be unchanged. Different fields require different types of values. The table of types below extends those defined in the JSON standard.

Type Description Example
Boolean True or false true
String(100) A string of 100 characters or less “Multai Cloud”
Int An integer 87
Decimal A generic decimal number 3.0
Float A floating-point number with 32-bit precision 3.14…
Double A floating-point number with 64-bit precision 3.14…
Enum One of a number of predetermined values “male” or “female”
Money A floating-point numeric value used to represent money 19.23
Timestamp A date and time string in the form YYYY-MM-DD HH:MM:SS “2009-01-14 05:41:04”
Date A date and time string in the form YYYY-MM-DD HH:MM:SS “2009-01-14 05:41:04”
Multi-Object A wrapper for any sub-fields under the current field “countries_and_brands”: [ { “country”: “FR”, “brand”: { “id”: 466, “name”: “PKR” } } ]
Array A list containing one or more values [87, 45, 99.12, 101.71]

JSON fields and values use underscores, e.g., audit_type_direct.

Next  Previous


Authentication

In every API call you make to Multai API, you must include Authentication token to authenticate yourself. Personal Access Tokens are a useful mechanism for accessing the API. You can create many, but not unlimited, personal access tokens (It is recommended to add description to each token)

WARNING: Do not share your personal access token or your application secret with anyone outside your organization. Please contact our support if you’re concerned your token has been compromised.

Users can create authentication tokens in the Multai Console.

Next  Previous


Load Balancer

Multai Load Balancer

Balancer

List All
GET/loadBalancer/balancer?projectId={PROJECT_ID}

Describe all the balancers and their full JSONs


Example URI

GET /loadBalancer/balancer?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "2",
  "items": [
    {
      "id": "lb-12345",
      "name": "best_load_balancer_in_the_world",
      "timeouts": {
        "draining": 300,
        "idle": 60
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "dnsCnameAliases": [
        "www.best-load-balancer.com",
        "www.best-load-balancer-in-the-world.com"
      ]
    },
    {
      "id": "lb-67890",
      "name": "best_load_balancer_in_the_world_2",
      "timeouts": {
        "draining": 300,
        "idle": 60
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production2"
        }
      ],
      "dnsCnameAliases": []
    }
  ]
}

Create
POST/loadBalancer/balancer?projectId={PROJECT_ID}

Create a new balancer.

Body parameters:

  • name - string - (required)
    balancer name. must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

Timeouts

  • timeout.draining - int - (required) The time for the load balancer to keep connections alive before reporting the target as de-registered, in seconds (range: 1 - 3600).

  • timeout.idle - int - (required) The idle timeout value, in seconds. (range: 1 - 3600).

Tags

  • tags.key - string - (optional)
    The tag’s key

  • tags.value - string - (optional)
    The tag’s value

DNS CName Aliases

  • dnsCnameAliases[] - string - (optional) Aliases for resolving balancer records

Example URI

POST /loadBalancer/balancer?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}
Body
{
  "balancer": {
    "name": "best_load_balancer_in_the_world",
    "timeouts": {
      "draining": 300,
      "idle": 60
    },
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ],
    "dnsCnameAliases": [
      "www.best-load-balancer.com"
    ]
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "lb-12345",
      "name": "best_load_balancer_in_the_world",
      "timeouts": {
        "draining": 300,
        "idle": 60
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "dnsCnameAliases": [
        "www.best-load-balancer.com"
      ]
    }
  ]
}

Update
PUT/loadBalancer/balancer/{BALANCER_ID}?projectId={PROJECT_ID}

Update one or more parameters in your load balancer. Use the balancer Json in the body to update the balancer. Only the specified fields will be affected.


Example URI

PUT /loadBalancer/balancer/lb-12345?projectId=pr-12345

Parameters

  • BALANCER_ID
    string (required) Example: lb-12345

    (required) The balancer id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request  Update Timeouts
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "balancer": {
    "timeouts": {
      "draining": 360,
      "idle": 30
    },
    "dnsCnameAliases": [
      "www.best-load-balancer.com"
    ]
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{}

Read
GET/loadBalancer/balancer/{BALANCER_ID}?projectId={PROJECT_ID}

Describe a specific balancer


Example URI

GET /loadBalancer/balancer/lb-12345?projectId=pr-12345

Parameters

  • BALANCER_ID
    string (required) Example: lb-12345

    (required) The balancer id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "lb-12345",
      "name": "best_load_balancer_in_the_world",
      "timeouts": {
        "draining": 300,
        "idle": 60
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "dnsCnameAliases": [
        "www.best-load-balancer-in-the-world.com"
      ]
    }
  ]
}

Delete
DELETE/loadBalancer/balancer/{BALANCER_ID}?projectId={PROJECT_ID}

Delete an existing balancer.


Example URI

DELETE /loadBalancer/balancer/lb-12345?projectId=pr-12345

Parameters

  • BALANCER_ID
    string (required) Example: lb-12345

    (required) The balancer id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}

Target Set

List All
GET/loadBalancer/targetSet?projectId=

Describe all the target sets and their full JSONs


Example URI

GET /loadBalancer/targetSet?projectId=

Request
HideShow
Headers
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "2",
  items: [{
    "id": "ts-12345",
    "name": "targetSet1",
    "balancerId": "lb-5470a9fb",
    "deploymentId": "de-12345",
    "protocol": "HTTP",
    "weight": 1,
    "healthCheck": {
        "interval" : 10,
        "path": "/healthCheck",
        "port": 80,
        "protocol": "HTTP",
        "timeout": 5,
        "healthyThresholdCount": 2,
        "unhealthyThresholdCount": 3
    },
    "tags": [{
        "key": "Environment",
        "value": "Production"
    }]
    },
    {
    "id": "ts-67890",
    "name": "targetSet2",
    "balancerId": "lb-5470a9fb",
    "deploymentId": "de-12345",
    "protocol": "HTTP",
    "weight": 1,
    "healthCheck": {
        "interval" : 10,
        "path": "/healthCheck",
        "port": 80,
        "protocol": "HTTP",
        "timeout": 5,
        "healthyThresholdCount": 2,
        "unhealthyThresholdCount": 3
    },
    "tags": [{
        "key": "Environment",
        "value": "Production2"
    }]
    }
  ]  
}

Create
POST/loadBalancer/targetSet?projectId={PROJECT_ID}

Create a new target set

Body parameters:

General

  • name - string - (required)
    The name of the Target Set . Must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

  • balancerId - string - (required) The id of the balancer

  • deploymentId - string - (required) The id of the deployment

  • protocol - string - (required)
    The protocol the balancer uses when performing health checks on targets

  • weight - int - (required)
    Defined how the traffic is distributed between the Target Sets

Health Check

  • healthCheck.interval - int - (required)
    The approximate amount of time (in seconds) between health checks of an individual target

  • healthCheck.path - string - (required)
    The destination path to use when performing health checks on targets

  • healthCheck.port - int - (required)
    The port the load balancer uses when performing health checks on targets

  • healthCheck.protocol - string - (required)
    The protocol the load balancer uses when performing health checks on targets

  • healthCheck.timeout - int - (required)
    The amount of time (in seconds) in which no response from the health check considered as failed

  • healthCheck.healthyThresholdCount - int - (required)
    The number of consecutive health checks required to succeed before considering a target as healthy

  • healthCheck.unhealthyThresholdCount - int - (required)
    The number of consecutive health check required to failed before considering a target as unhealthy

Tags

  • tags.key - string - (required)
    The tag’s key

  • tags.value - string - (required)
    The tag’s value


Example URI

POST /loadBalancer/targetSet?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}
Body
{
  "targetSet": {
    "name": "targetSet1",
    "balancerId": "lb-5470a9fb",
    "deploymentId": "de-12345",
    "protocol": "HTTP",
    "weight": 1,
    "healthCheck": {
      "interval": 10,
      "path": "/healthCheck",
      "port": 80,
      "protocol": "HTTP",
      "timeout": 5,
      "healthyThresholdCount": 2,
      "unhealthyThresholdCount": 3
    },
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ]
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "ts-12345",
      "name": "targetSet1",
      "balancerId": "lb-5470a9fb",
      "deploymentId": "de-12345",
      "protocol": "HTTP",
      "weight": 1,
      "healthCheck": {
        "interval": 10,
        "path": "/healthCheck",
        "port": 80,
        "protocol": "HTTP",
        "timeout": 5,
        "healthyThresholdCount": 2,
        "unhealthyThresholdCount": 3
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Update
PUT/loadBalancer/targetSet/{TARGET_SET_ID}?projectId={PROJECT_ID}

Update one or more parameters in your target sets. Only the specified fields will be affected.


Example URI

PUT /loadBalancer/targetSet/ts-12345?projectId=pr-12345

Parameters

  • TARGET_SET_ID
    string (required) Example: ts-12345

    (required) The target set id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request  Update Weight
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "targetSet": {
    "weight": 1
  }
}

Request  Update Health Check
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "targetSet": {
    "healthCheck": {
      "interval": 10,
      "path": "/healthCheck",
      "port": 80,
      "protocol": "HTTP",
      "timeout": 5,
      "healthyThresholdCount": 2,
      "unhealthyThresholdCount": 3
    }
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{}

Read
GET/loadBalancer/targetSet/{TARGET_SET_ID}?projectId={PROJECT_ID}

Describe a specific target sets


Example URI

GET /loadBalancer/targetSet/ts-12345?projectId=pr-12345

Parameters

  • TARGET_SET_ID
    string (required) Example: ts-12345

    (required) The target set id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "ts-12345",
      "name": "targetSet1",
      "balancerId": "lb-5470a9fb",
      "deploymentId": "de-12345",
      "protocol": "HTTP",
      "weight": 1,
      "healthCheck": {
        "interval": 10,
        "path": "/healthCheck",
        "port": 80,
        "protocol": "HTTP",
        "timeout": 5,
        "healthyThresholdCount": 2,
        "unhealthyThresholdCount": 3
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Delete
DELETE/loadBalancer/targetSet/{TARGET_SET_ID}?projectId={PROJECT_ID}

Delete an existing target sets


Example URI

DELETE /loadBalancer/targetSet/ts-12345?projectId=pr-12345

Parameters

  • TARGET_SET_ID
    string (required) Example: ts-12345

    (required) The target set id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}

Target

List All
GET/loadBalancer/target?projectId=

Describe all the targets and their full JSONs


Example URI

GET /loadBalancer/target?projectId=

Request
HideShow
Headers
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "2",
  "items": [
    {
      "id": "t-12345",
      "name": "target1",
      "balancerId": "lb-12345",
      "targetSetId": "ts-12345",
      "address": "http://10.0.0.2:1337",
      "host": "10.0.0.2",
      "port": 1337,
      "weight": 1,
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    },
    {
      "id": "t-67890",
      "name": "target2",
      "balancerId": "lb-67890",
      "targetSetId": "ts-12345",
      "address": "http://10.0.0.3:1337",
      "host": "10.0.0.3",
      "port": 1337,
      "weight": 1,
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Create
POST/loadBalancer/target?projectId={PROJECT_ID}

Create a new target.

Body parameters:

General

  • name - string - (required)
    The name of the Target . Must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

  • balancerId - string - (required) The id of the balancer

  • targetSetId - string - (required) The id of the Target Set

  • host - string - (required) The address (IP or URL) of the target to register without the protocol scheme

  • port - int - (optional) Defined the port of the target

  • weight - int - (required) Defined how the traffic is distributed between the Target

Tags

  • tags[].key - string - (optional)
    The tag’s key

  • tags[].value - string - (optional)
    The tag’s value


Example URI

POST /loadBalancer/target?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}
Body
{
  "target": {
    "name": "target1",
    "balancerId": "lb-12345",
    "targetSetId": "ts-12345",
    "host": "10.0.0.2",
    "port": 1337,
    "weight": 1,
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ]
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [{
    "id": "t-12345",
    "name": "target1",
    "balancerId":"lb-12345",
    "targetSetId":"ts-12345",
    "address:"http://10.0.0.2:1337",
    "host":"10.0.0.2",
    "port":1337,
    "weight":1,
    "tags": [{
        "key": "Environment",
        "value": "Production"
     }]
  }]
}

Update
PUT/loadBalancer/target/{TARGET_ID}?projectId={PROJECT_ID}

Update one or more parameters in your targets. Only the specified fields will apply.


Example URI

PUT /loadBalancer/target/t-12345?projectId=pr-12345

Parameters

  • TARGET_ID
    string (required) Example: t-12345

    (required) The target id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request  Weight
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "target": {
    "weight": 1
  }
}

Request  host and port
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "target":{
    "host":"10.0.0.2",
    "port":80,
    "status": {
      "readiness": "READY"
    },
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{}

Get
GET/loadBalancer/target/{TARGET_ID}

Describe a specific target


Example URI

GET /loadBalancer/target/t-12345

Parameters

  • TARGET_ID
    string (required) Example: t-12345

    (required) The target id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "t-12345",
      "name": "target1",
      "balancerId": "lb-12345",
      "targetSetId": "ts-12345",
      "address": "http://10.0.0.2:1337",
      "host": "10.0.0.2",
      "port": 1337,
      "weight": 1,
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Delete
DELETE/loadBalancer/target/{TARGET_ID}?projectId={PROJECT_ID}

Delete an existing target


Example URI

DELETE /loadBalancer/target/t-12345?projectId=pr-12345

Parameters

  • TARGET_ID
    string (required) Example: t-12345

    (required) The target id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}

Listener

List All
GET/loadBalancer/listener?projectId=

Describe all the listeners and their full JSONs


Example URI

GET /loadBalancer/listener?projectId=

Request
HideShow
Headers
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "2",
  items: [{
    "id": "ls-12345",
    "balancerId": "lb-12345",
    "protocol": "HTTP",
    "port":"80",
    "tags": [{
        "key": "Environment",
        "value": "Production"
    }]
  },
  {
    "id": "ls-67890",
    "balancerId": "lb-67890",
    "protocol": "HTTP",
    "port":"81",
    "tags": [{
        "key": "Environment",
        "value": "Production2"
     }]
  }
  ]
}

Create
POST/loadBalancer/listener?projectId={PROJECT_ID}

Create a new listener.

Body parameters:

General

  • balancerId - int - (required) The id of the balancer

  • protocol - int - (required) The protocol to allow connections to the load balancer

  • port - int - (required) The port on which the load balancer is listening.

  • tlsConfig.minVersion - string - (required) MinVersion contains the minimum SSL/TLS version that is acceptable (1.0 is the minimum)

  • tlsConfig.maxVersion - string - (required) MaxVersion contains the maximum SSL/TLS version that is acceptable.

  • tlsConfig.sessionTicketsDisabled - boolean - (required) May be set to true to disable session ticket (resumption) support

  • tlsConfig.preferServerCipherSuites - boolean - (required) Controls whether the server selects the client’s most preferred ciphersuite, or the server’s most preferred ciphersuite

  • tlsConfig.cipherSuites - string - (required) List of supported cipher suites. If cipherSuites is nil, TLS uses a list of suites supported by the implementation

  • tlsConfig.insecureSkipVerify - int - (required) Controls whether a client verifies the server’s certificate chain and host name. If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. (This should be used only for testing)

  • tlsConfig.certificateIds - boolean - (required) Contains one or more certificate chains to present to the other side of the connection.


Example URI

POST /loadBalancer/listener?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}
Body
{
  "listener": {
    "balancerId": "lb-5470a9fb",
    "protocol": "HTTP",
    "port": "443",
    "tlsConfig": {
      "minVersion": "TLS10",
      "maxVersion": "TLS12",
      "sessionTicketsDisabled": true,
      "preferServerCipherSuites": true,
      "cipherSuites": [
        "TLS_RSA_WITH_AES_256_CBC_SHA",
        "TLS_RSA_WITH_AES_128_CBC_SHA256"
      ],
      "insecureSkipVerify": false,
      "certificateIds": [
        "ce-12345",
        "ce-67890"
      ]
    },
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ]
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "ls-12345",
      "balancerId": "lb-5470a9fb",
      "protocol": "HTTP",
      "port": "443",
      "tlsConfig": {
        "minVersion": "TLS10",
        "maxVersion": "TLS12",
        "sessionTicketsDisabled": true,
        "preferServerCipherSuites": true,
        "cipherSuites": [
          "TLS_RSA_WITH_AES_256_CBC_SHA",
          "TLS_RSA_WITH_AES_128_CBC_SHA256"
        ],
        "insecureSkipVerify": false,
        "certificateIds": [
          "ce-12345",
          "ce-67890"
        ]
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Update
PUT/loadBalancer/listener/{LISTENER_ID}?projectId={PROJECT_ID}

Update one or more parameters in your listeners. Only the specified fields will be affected.


Example URI

PUT /loadBalancer/listener/ls-12345?projectId=pr-12345

Parameters

  • LISTENER_ID
    string (required) Example: ls-12345

    (required) The listener id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request  Update Port
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "listener": {
    "port": "8080"
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{}

Read
GET/loadBalancer/listener/{LISTENER_ID}?projectId={PROJECT_ID}

Describe a specific listener


Example URI

GET /loadBalancer/listener/ls-12345?projectId=pr-12345

Parameters

  • LISTENER_ID
    string (required) Example: ls-12345

    (required) The listener id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "ls-12345",
      "balancerId": "lb-12345",
      "protocol": "HTTP",
      "port": "80",
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ]
}

Delete
DELETE/loadBalancer/listener/{LISTENER_ID}?projectId={PROJECT_ID}

Delete an existing listener


Example URI

DELETE /loadBalancer/listener/ls-12345?projectId=pr-12345

Parameters

  • LISTENER_ID
    string (required) Example: ls-12345

    (required) The listener id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}

Routing Rule

List All
GET/loadBalancer/routingRule?projectId=

Describe all the routing rules and their full JSONs


Example URI

GET /loadBalancer/routingRule?projectId=

Request
HideShow
Headers
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "2",
  "items": [
    {
      "id": "rr-12345",
      "balancerId": "lb-12345",
      "route": "PathRegexp(`/v1`)",
      "targetSetIds": [
        "ts-12345",
        "ts-67890"
      ],
      "listenerId": "ls-12345",
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "strategy": "ROUNDROBIN",
      "priority": 1
    },
    {
      "id": "rr-67890",
      "balancerId": "lb-12345",
      "route": "PathRegexp(`/v2`)",
      "targetSetIds": [
        "ts-12345",
        "ts-67890"
      ],
      "listenerId": "ls-12345",
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "strategy": "IPHASH",
      "priority": 5
    }
  ]
}

Create
POST/loadBalancer/routingRule?projectId={PROJECT_ID}

Create a new routing rule

Body parameters:

General

  • balancerId - string - (required) The id of the balancer

  • route - string - (required) Route defines a simple language for matching HTTP requests and route the traffic accordingly. Route provides series of matchers that follow the syntax:

Path matcher: — Path("/foo/bar") // trie-based PathRegexp(“/foo/.*”) // regexp-based

Method matcher: — Method(“GET”) // trie-based MethodRegexp(“POST|PUT”) // regexp based

Header matcher: — Header(“Content-Type”, “application/json”) // trie-based HeaderRegexp(“Content-Type”, “application/.*”) // regexp based

Matchers can be combined using && operator: — Method(“POST”) && Path("/v1")

  • targetSetIds - string - (required) The id of the Target Set

  • listenerId - string - (required) The id of the Listener

Tags

  • tags[].key - string - (optional)
    The tag’s key

  • tags[].value - string - (optional)
    The tag’s value

  • strategy - string - (optional) The routing strategy, Valid Values are: ROUNDROBIN, RANDOM, LEASTCONN, IPHASH. Default routing strategy is ROUNDROBIN.

  • priority - int - (optional) The routing rule priority, Minimum value is 1. Default priority is 1.


Example URI

POST /loadBalancer/routingRule?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}
Body
{
  "routingRule": {
    "balancerId": "lb-12345",
    "route": "PathRegexp(`/`)",
    "targetSetIds": [
      "ts-12345",
      "ts-67890"
    ],
    "listenerId": "ls-12345",
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ],
    "strategy": "ROUNDROBIN",
    "priority": 10
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "rr-12345",
      "balancerId": "lb-12345",
      "route": "PathRegexp(`/`)",
      "targetSetIds": [
        "ts-12345",
        "ts-67890"
      ],
      "listenerId": "ls-12345",
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "strategy": "ROUNDROBIN",
      "priority": 10
    }
  ]
}

Update
PUT/loadBalancer/routingRule/{ROUTING_RULE_ID}?projectId={PROJECT_ID}

Update one or more parameters in your routing rule. Only the specified fields will be affected.


Example URI

PUT /loadBalancer/routingRule/rr-12345?projectId=pr-12345

Parameters

  • ROUTING_RULE_ID
    string (required) Example: rr-12345

    (required) The routing rule id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request  Update Route
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}
Body
{
  "routingRule":{
    "route": "HeaderRegexp(`User-Defined-Header`, `application1`)",
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{}

Read
GET/loadBalancer/routingRule/{ROUTING_RULE_ID}?projectId={PROJECT_ID}

Describe a specific routing rule


Example URI

GET /loadBalancer/routingRule/rr-12345?projectId=pr-12345

Parameters

  • ROUTING_RULE_ID
    string (required) Example: rr-12345

    (required) The routing rule id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${token}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "id": "rr-12345",
      "balancerId": "lb-12345",
      "route": "PathRegexp(`/v1`)",
      "targetSetIds": [
        "ts-12345",
        "ts-67890"
      ],
      "listenerId": "ls-12345",
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ],
      "strategy": "ROUNDROBIN",
      "priority": 2
    }
  ]
}

Delete
DELETE/loadBalancer/routingRule/{ROUTING_RULE_ID}?projectId={PROJECT_ID}

Delete an existing routing rule


Example URI

DELETE /loadBalancer/routingRule/rr-12345?projectId=pr-12345

Parameters

  • ROUTING_RULE_ID
    string (required) Example: rr-12345

    (required) The routing rule id you want to update

    PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer ${TOKEN}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": {
    "code": 200,
    "message": "OK"
  }
}
Next  Previous


Spectrum

Multai Spectrum

Metrics

Report
POST/spectrum/metricData?projectId={PROJECT_ID}

Publishes metric data points to multai spectrum

Body parameters:

  • namespace - string - (required)
    The name of the namespace.

  • dimensions - array - (at least one required)
    The dimension(s) associated with the metric.

  • metrics - array - (at least one required)
    The metric(s) data.

Metrics:

  • metrics[].name - string - (required)
    The name of the metric.

  • metrics[].value - double - (required)
    The value of the metric.

  • metrics[].unit - string - (required)
    The unit of the metric.

Dimensions:

  • dimensions[].name - string - (required)
    The name of the dimension.

  • dimensions[].value - string - (required)
    The value representing the dimension.


Example URI

POST /spectrum/metricData?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Authorization: Bearer ${token}
Body
{
  "metricData": [
    {
      "namespace": "myOrganization",
      "dimensions": [
        {
          "name": "target_set_id",
          "value": "ts-12345"
        }
      ],
      "metrics": [
        {
          "name": "http_status_target_4xx",
          "value": 10,
          "unit": "count"
        }
      ]
    },
    ...
  ]
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "request": {
    "id": "cb6509c2-84a9-4e1e-a6b4-5b91fa5f2450",
    "url": "/spectrum/metricData?projectId=pr-12345",
    "method": "POST",
    "timestamp": "1970-01-01T01:00:00.000+0000"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "multai:spectrum:metricData",
    "items": [],
    "count": 0
  }
}

Query
POST/spectrum/metricStatisticsQuery?projectId={PROJECT_ID}

Query for specific metric statistics

Body parameters:

  • namespace - string - (required)
    The name of the namespace.

  • metricName - string - (required)
    The name of the metric.

  • statistic - string - (required) The metric statistic. Allowed values: average, count, minimum, maximum, sum

  • dimensions - array - (at least one required) The dimension(s) to report.

  • dateRange - array - (required) Dates containing the range to determine the data points to return.

  • timeInterval - string
    The time interval granularity of the returned data points.
    Allowed values: 1m, 5m, 15m, 30m, 1h, 2h, 6h, 12h, 24h

Date Range:

  • from - date - (required)
    The Unix time stamp that determines the first data point to return.

  • to - date - (required)
    The Unix time stamp that determines the last data point to return.

Dimensions:

  • dimensions[].name - string - (required)
    The name of the dimension.

  • dimensions[].value - string - (required)
    The value representing the dimension.


Example URI

POST /spectrum/metricStatisticsQuery?projectId=pr-12345

Parameters

  • PROJECT_ID
    string (required) Example: pr-12345

    (required) The project id.


Request
HideShow
Headers
Authorization: Bearer ${token}
Body
{
  "namespace": "myOrganization",
  "metricName": "http_request_latency",
  "timeInterval": "1m",
  "statistic": "average",
  "dimensions": [
    {
      "name": "target_set_id",
      "value": "ts-12345"
    }
  ],
  "dateRange": {
    "from": "1970-01-01T01:00:00.000Z", // 1483232400000
    "to": "1970-01-01T12:00:00.000Z"    // 1483232412345
  }
}

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "request": {
    "id": "f6f854fb-db63-4e9b-9426-c5835874f669",
    "url": "/spectrum/metricStatisticsQuery?projectId=pr-fa88237a",
    "method": "POST",
    "timestamp": "1970-01-01T23:00:00.000Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "multai:spectrum:metricStatisticsQuery",
    "items": [
      {
        "aggregations": [
          {
            "dimensions": [
              {
                "name": "target_set_id",
                "value": "ts-12345"
              },
              ...
            ],
            "datapoints": [
              {
                "timestamp": "1970-01-01T08:00:00.000Z",
                "statistics": {
                  "average": 123.123
                }
              },
              ...
            ]
          }
        ]
      }
    ],
    "count": 1
  }
}
Previous