Environment

environment.Trigger

Estimated reading: 17 minutes 732 views
Namespace: Environment
REST: https://[hoster-api-host]/1.0/environment/trigger/rest/{method-name}
Scripting: environment.trigger.{method-name}
This service implements the environment’s trigger handling and management functionality. There are two types of triggers:
  • auto-scaling – custom conditions for nodes’ addition (scale out) and removal (scale in) based on the load, which allows implementing automatic horizontal scaling. Learn more in the documentation.
  • load alert – custom conditions for email notifications based on the nodes’ load, i.e. a particular resource type is above/below the stated value for the designated period. Learn more in the documentation.

Methods

AddAutoScalingTrigger (envName, session, data ) :

Adds a new auto-scaling trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/addautoscalingtrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”
  • data : “string”

    JSON object with trigger’s configuration.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/addautoscalingtrigger?data=[string]&envName=[string]&session=[string]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

AddLoadAlertTrigger (envName, session, data ) :

Adds a new load alert for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/addloadalerttrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • data : “string”

    JSON object with trigger’s configuration.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/addloadalerttrigger?data=[string]&envName=[string]&session=[string]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

AddTrigger (envName, session, data ) :

Adds a new trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/addtrigger

Deprecated

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • data : “string”

    JSON object with trigger’s configuration.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/addtrigger?data=[string]&envName=[string]&session=[string]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

AutoScalingHistory (envName, session, [triggerId], [actionTypes], [startTime], [endTime], startRow, resultCount, [orderField], [orderDirection], [skipResults], [nodeGroup], [resourceTypes], [triggerLogId] ) :

Returns a list of logs for the specified environment’s auto-scaling triggers execution.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/autoscalinghistory

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • triggerId : “int” (optional)

    unique identifier of the target auto-scaling trigger.

  • actionTypes : “string” (optional)

    a semicolon-separated list of triggers’ action types (for filtering). (supported values: ADDNODE, REMOVENODE).

  • startTime : “string” (optional)

    start time (UTC) of a period for which actions should be shown. In the format “yyyy-MM-dd hh:mm:ss”, e.g. “2022-11-16 00:00:00”.

  • endTime : “string” (optional)

    end time (UTC) of a period for which actions should be shown. In the format “yyyy-MM-dd hh:mm:ss”, e.g. “2022-11-16 00:00:00”.

  • startRow : “int”

    returns information starting from the specified row in the response (starts with 0, by default).

  • resultCount : “int”

    returns the specified number of rows from the response (10 by default).

  • orderField : “string” (optional)

    sorts results by the specified field.

  • orderDirection : “string” (optional)

    sorts results in the ascending (ASC) or descending (DESC) order.

  • skipResults : “string” (optional)

    skips results with matching text (for filtering).

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • resourceTypes : “string” (optional)

    a semicolon-separated list of triggers’ resource types (for filtering).

  • triggerLogId : “int” (optional)

    unique identifier of the target log file.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/autoscalinghistory?resourceTypes=[string]&resultCount=[int]&startRow=[int]&session=[string]&triggerId=[int]&nodeGroup=[string]&actionTypes=[string]&skipResults=[string]&envName=[string]&orderDirection=[string]&startTime=[string]&endTime=[string]&orderField=[string]&triggerLogId=[int]

Response

  • PagedArrayResponse
    {
       "array": [
          {
             "actionCustomData": "string",
             "actionType": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)",
             "conditionType": "LESS(<) | GREATER(>)",
             "conditionValue": "double",
             "conditionValueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)",
             "error": "string",
             "fireData": "string",
             "killedProcesses": [
                {
                   "env": {
                      "appid": "string",
                      "domain": {
                         "domain": "string"
                      }
                   },
                   "hardwareNode": {
                      "hostname": "string",
                      "id": "string",
                      "ipAddress": "string"
                   },
                   "osNode": {
                      "envId": "string",
                      "osNodeId": "string"
                   },
                   "processId": "int",
                   "processName": "string",
                   "softNode": {
                      "nodeId": "string",
                      "nodeName": "string",
                      "nodeType": "string"
                   },
                   "uid": "int"
                },
                "..."
             ],
             "nodeGroup": "string",
             "nodeName": "string",
             "nodeType": "string",
             "notificationSent": "boolean",
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "response": "string",
             "result": "int",
             "sequentialExecCount": "int",
             "trigger": {
                "actions": [
                   {
                      "customData": "string",
                      "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                   },
                   "..."
                ],
                "condition": {
                   "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                   "type": "LESS(<) | GREATER(>)",
                   "value": "double",
                   "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
                },
                "isDeleted": "boolean",
                "isEnabled": "boolean",
                "name": "string",
                "nodeGroup": "string",
                "period": "int",
                "state": "IDLE(0) | ACQUIRED(1)",
                "vTypes": [
                   "VType",
                   "..."
                ]
             },
             "triggerName": "string"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string",
       "totalCount": "long"
    }
    

DeleteAutoScalingTrigger (envName, session, id ) :

Deletes an existing auto-scaling trigger from the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/deleteautoscalingtrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target auto-scaling trigger.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/deleteautoscalingtrigger?envName=[string]&session=[string]&id=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

DeleteLoadAlertTrigger (envName, session, id ) :

Deletes an existing load alert trigger from the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/deleteloadalerttrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target load alert trigger.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/deleteloadalerttrigger?envName=[string]&session=[string]&id=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

DeleteTrigger (envName, session, id ) :

Deprecated. Use the DeleteAutoScalingTrigger or DeleteLoadAlertTrigger methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/deletetrigger

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • id : “int”

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/deletetrigger?envName=[string]&session=[string]&id=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

EditAutoScalingTrigger (envName, session, id, data ) :

Adjusts an existing auto-scaling trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/editautoscalingtrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target auto-scaling trigger.

  • data : “string”

    JSON object with trigger’s configuration.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/editautoscalingtrigger?data=[string]&envName=[string]&session=[string]&id=[int]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

EditLoadAlertTrigger (envName, session, id, data ) :

Adjusts an existing load alert trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/editloadalerttrigger

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target load alert trigger.

  • data : “string”

    JSON object with trigger’s configuration.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/editloadalerttrigger?data=[string]&envName=[string]&session=[string]&id=[int]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

EditTrigger (envName, session, id, data ) :

Deprecated. Use the EditAutoScalingTrigger or EditLoadAlertTrigger methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/edittrigger

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • id : “int”
  • data : “string”

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/edittrigger?data=[string]&envName=[string]&session=[string]&id=[int]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "actions": [
             {
                "customData": "string",
                "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
             },
             "..."
          ],
          "condition": {
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "type": "LESS(<) | GREATER(>)",
             "value": "double",
             "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
          },
          "isDeleted": "boolean",
          "isEnabled": "boolean",
          "name": "string",
          "nodeGroup": "string",
          "period": "int",
          "state": "IDLE(0) | ACQUIRED(1)",
          "vTypes": [
             "VType",
             "..."
          ]
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

GetAutoScalingTriggers (envName, session, [actionTypes] ) :

Returns a list of auto-scaling triggers for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/getautoscalingtriggers

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • actionTypes : “string” (optional)

    a semicolon-separated list of the trigger action types (for filtering).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/getautoscalingtriggers?envName=[string]&session=[string]&actionTypes=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "actions": [
                {
                   "customData": "string",
                   "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                },
                "..."
             ],
             "condition": {
                "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                "type": "LESS(<) | GREATER(>)",
                "value": "double",
                "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
             },
             "isDeleted": "boolean",
             "isEnabled": "boolean",
             "name": "string",
             "nodeGroup": "string",
             "period": "int",
             "state": "IDLE(0) | ACQUIRED(1)",
             "vTypes": [
                "VType",
                "..."
             ]
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetLoadAlertTriggers (envName, session, [actionTypes] ) : 

Returns a list of load alert triggers for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/getloadalerttriggers

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • actionTypes : “string” (optional)

    a semicolon-separated list of the trigger action types (for filtering).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/getloadalerttriggers?envName=[string]&session=[string]&actionTypes=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "actions": [
                {
                   "customData": "string",
                   "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                },
                "..."
             ],
             "condition": {
                "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                "type": "LESS(<) | GREATER(>)",
                "value": "double",
                "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
             },
             "isDeleted": "boolean",
             "isEnabled": "boolean",
             "name": "string",
             "nodeGroup": "string",
             "period": "int",
             "state": "IDLE(0) | ACQUIRED(1)",
             "vTypes": [
                "VType",
                "..."
             ]
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetTriggerLogs (envName, session, [triggerId], [actionTypes], [startTime], [endTime], startRow, resultCount, [orderField], [orderDirection], [skipResults], [nodeGroup], [resourceTypes], [triggerLogId] ) :

Deprecated. Use the AutoScalingHistory or LoadAlertHistory methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/gettriggerlogs

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • triggerId : “int” (optional)
  • actionTypes : “string” (optional)
  • startTime : “string” (optional)
  • endTime : “string” (optional)
  • startRow : “int”
  • resultCount : “int”
  • orderField : “string” (optional)
  • orderDirection : “string” (optional)
  • skipResults : “string” (optional)
  • nodeGroup : “string” (optional)
  • resourceTypes : “string” (optional)
  • triggerLogId : “int” (optional)

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/gettriggerlogs?resourceTypes=[string]&resultCount=[int]&startRow=[int]&session=[string]&triggerId=[int]&nodeGroup=[string]&actionTypes=[string]&skipResults=[string]&envName=[string]&orderDirection=[string]&startTime=[string]&endTime=[string]&orderField=[string]&triggerLogId=[int]

Response

  • PagedArrayResponse
    {
       "array": [
          {
             "actionCustomData": "string",
             "actionType": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)",
             "conditionType": "LESS(<) | GREATER(>)",
             "conditionValue": "double",
             "conditionValueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)",
             "error": "string",
             "fireData": "string",
             "killedProcesses": [
                {
                   "env": {
                      "appid": "string",
                      "domain": {
                         "domain": "string"
                      }
                   },
                   "hardwareNode": {
                      "hostname": "string",
                      "id": "string",
                      "ipAddress": "string"
                   },
                   "osNode": {
                      "envId": "string",
                      "osNodeId": "string"
                   },
                   "processId": "int",
                   "processName": "string",
                   "softNode": {
                      "nodeId": "string",
                      "nodeName": "string",
                      "nodeType": "string"
                   },
                   "uid": "int"
                },
                "..."
             ],
             "nodeGroup": "string",
             "nodeName": "string",
             "nodeType": "string",
             "notificationSent": "boolean",
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "response": "string",
             "result": "int",
             "sequentialExecCount": "int",
             "trigger": {
                "actions": [
                   {
                      "customData": "string",
                      "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                   },
                   "..."
                ],
                "condition": {
                   "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                   "type": "LESS(<) | GREATER(>)",
                   "value": "double",
                   "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
                },
                "isDeleted": "boolean",
                "isEnabled": "boolean",
                "name": "string",
                "nodeGroup": "string",
                "period": "int",
                "state": "IDLE(0) | ACQUIRED(1)",
                "vTypes": [
                   "VType",
                   "..."
                ]
             },
             "triggerName": "string"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string",
       "totalCount": "long"
    }
    

GetTriggers (envName, session, [actionTypes] ) :

Deprecated. Use the GetAutoScalingTriggers or GetLoadAlertTriggers methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/gettriggers

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • actionTypes : “string” (optional)

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/gettriggers?envName=[string]&session=[string]&actionTypes=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "actions": [
                {
                   "customData": "string",
                   "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                },
                "..."
             ],
             "condition": {
                "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                "type": "LESS(<) | GREATER(>)",
                "value": "double",
                "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
             },
             "isDeleted": "boolean",
             "isEnabled": "boolean",
             "name": "string",
             "nodeGroup": "string",
             "period": "int",
             "state": "IDLE(0) | ACQUIRED(1)",
             "vTypes": [
                "VType",
                "..."
             ]
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

LoadAlertHistory (envName, session, [triggerId], [actionTypes], [startTime], [endTime], startRow, resultCount, [orderField], [orderDirection], [skipResults], [nodeGroup], [resourceTypes], [triggerLogId] ) :

Returns a list of logs for the specified environment’s load alert triggers execution.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/loadalerthistory

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • triggerId : “int” (optional)

    unique identifier of the target load alert trigger.

  • actionTypes : “string” (optional)

    a semicolon-separated list of triggers’ action types (for filtering) (supported values: NOTIFY, NOTIFY_OOM).

  • startTime : “string” (optional)

    start time (UTC) of a period for which actions should be shown. In the format “yyyy-MM-dd hh:mm:ss”, e.g. “2022-11-16 00:00:00”.

  • endTime : “string” (optional)

    end time (UTC) of a period for which actions should be shown. In the format “yyyy-MM-dd hh:mm:ss”, e.g. “2022-11-16 00:00:00”.

  • startRow : “int”

    returns information starting from the specified row in the response (starts with 0, by default).

  • resultCount : “int”

    returns the specified number of rows from the response (10 by default).

  • orderField : “string” (optional)

    sorts results by the specified field.

  • orderDirection : “string” (optional)

    sorts results in the ascending (ASC) or descending (DESC) order.

  • skipResults : “string” (optional)

    skips results with matching text (for filtering).

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • resourceTypes : “string” (optional)

    a semicolon-separated list of triggers’ resource types (for filtering).

  • triggerLogId : “int” (optional)

    unique identifier of the target log file.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/loadalerthistory?resourceTypes=[string]&resultCount=[int]&startRow=[int]&session=[string]&triggerId=[int]&nodeGroup=[string]&actionTypes=[string]&skipResults=[string]&envName=[string]&orderDirection=[string]&startTime=[string]&endTime=[string]&orderField=[string]&triggerLogId=[int]

Response

  • PagedArrayResponse
    {
       "array": [
          {
             "actionCustomData": "string",
             "actionType": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)",
             "conditionType": "LESS(<) | GREATER(>)",
             "conditionValue": "double",
             "conditionValueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)",
             "error": "string",
             "fireData": "string",
             "killedProcesses": [
                {
                   "env": {
                      "appid": "string",
                      "domain": {
                         "domain": "string"
                      }
                   },
                   "hardwareNode": {
                      "hostname": "string",
                      "id": "string",
                      "ipAddress": "string"
                   },
                   "osNode": {
                      "envId": "string",
                      "osNodeId": "string"
                   },
                   "processId": "int",
                   "processName": "string",
                   "softNode": {
                      "nodeId": "string",
                      "nodeName": "string",
                      "nodeType": "string"
                   },
                   "uid": "int"
                },
                "..."
             ],
             "nodeGroup": "string",
             "nodeName": "string",
             "nodeType": "string",
             "notificationSent": "boolean",
             "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
             "response": "string",
             "result": "int",
             "sequentialExecCount": "int",
             "trigger": {
                "actions": [
                   {
                      "customData": "string",
                      "type": "NOTIFY(0) | REMOVE_NODE(1) | ADD_NODE(2) | NOTIFY_OOM(3)"
                   },
                   "..."
                ],
                "condition": {
                   "resourceType": "CLOUDLETS(0) | MEM(1) | CPU(2) | DISK(3) | INODES(4) | DISK_IOPS(5) | DISK_IO(6) | NET_EXT(7) | NET_EXT_OUT(8) | OOM_KILLER(9)",
                   "type": "LESS(<) | GREATER(>)",
                   "value": "double",
                   "valueType": "PERCENTAGES(PERCENTAGES) | SPECIFIC(SPECIFIC)"
                },
                "isDeleted": "boolean",
                "isEnabled": "boolean",
                "name": "string",
                "nodeGroup": "string",
                "period": "int",
                "state": "IDLE(0) | ACQUIRED(1)",
                "vTypes": [
                   "VType",
                   "..."
                ]
             },
             "triggerName": "string"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string",
       "totalCount": "long"
    }
    

SetAutoScalingTriggerEnabled (envName, session, id, enabled ) :

Enables or disables the auto-scaling trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/setautoscalingtriggerenabled

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target auto-scaling trigger.

  • enabled : “boolean”

    defines whether to enable (true) or disable (false) the specified trigger.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/setautoscalingtriggerenabled?envName=[string]&session=[string]&id=[int]&enabled=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

SetLoadAlertTriggerEnabled (envName, session, id, enabled ) :

Enables or disables the load alert trigger for the specified environment.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/setloadalerttriggerenabled

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target load alert trigger.

  • enabled : “boolean”

    defines whether to enable (true) or disable (false) the specified trigger.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/setloadalerttriggerenabled?envName=[string]&session=[string]&id=[int]&enabled=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

SetTriggerEnabled (envName, session, id, enabled ) :

Deprecated. Use the SetAutoScalingTriggerEnabled or SetLoadAlertTriggerEnabled methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/settriggerenabled

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • id : “int”
  • enabled : “boolean”

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/settriggerenabled?envName=[string]&session=[string]&id=[int]&enabled=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

SetTriggerEnabled (envName, session, id, enabled ) :

Deprecated. Use the SetAutoScalingTriggerEnabled or SetLoadAlertTriggerEnabled methods instead.

URL

https://[hoster-api-host]/1.0/environment/trigger/rest/settriggerenabled

Deprecated

Parameters

  • envName : “string”
  • session : “string”
  • id : “int”
  • enabled : “boolean”

Example

Method: POST

https://[hoster-api-host]/1.0/environment/trigger/rest/settriggerenabled?envName=[string]&session=[string]&id=[int]&enabled=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Leave a Comment