fbpx
POSThttps://api.spotinst.io/spectrum/metrics/action?accountId={ACCOUNT_ID}

Creates an Action.

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Account ID from Spotinst console

Example: act-12345
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${TOKEN}"
}
Body
Copied!
Downloaded!
{
  "action": {
    "enabled": true,
    "name": "DemoAction",
    "type": "EMAIL",
    "params": {
      "email": "demo@spotinst.com"
    }
  }
}

Body Attributes


  • action.enabled * Boolean
    Allowed values:can be either ‘true’ or ‘false’
  • action.name * String
    A name of your choice.
  • action.type * String
    Allowed values: "EMAIL","AWS_SNS","SLACK"
  • action.params * Object
    The Email, SNS or Slack parameters
  • action.params.email String
    Email Id
    Example: demo@spotinst.com
  • action.params.region String
    Region of the SNS topic
    Example: us-west-2
  • action.params.topicArn String
    SNS topic ARN
    Example: arn:aws:sns:us-west-2:988761411349:Zachi-Alert-Test-Topic
  • action.params.providerId String
    Provider Id of the Slack channel
    Example: prv-c4a058cb21e5
  • action.params.channelName String
    Slack channel name
    Example: demo-channel
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "6304d238-80e8-4743-92c1-971389272be2",
    "url": "/spectrum/metrics/action?accountId={AccountId}",
    "method": "POST",
    "timestamp": "2017-08-20T16:36:52.796Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:lb:action",
    "items": [
      {
        "id": "ac-664d6979ccbb",
        "enabled": true,
        "name": "DemoAction",
        "type": "EMAIL",
        "params": {
          "email": "demo@spotinst.com"
        },
        "updatedAt": "2017-08-20T16:36:52.764Z",
        "createdAt": "2017-08-20T16:36:52.764Z"
      }
    ],
    "count": 1
  }
}