Environment

environment.Security

Estimated reading: 7 minutes 443 views
Namespace: Environment
REST: https://[hoster-api-host]/1.0/environment/security/rest/{method-name}
Scripting: environment.security.{method-name}
This service is responsible for managing the environment firewall feature. You can get a rules list, manage specific rules, and enable/disable firewalls for environments. Learn more in the documentation.

Methods

AddRule (envName, session, rule, [nodeGroup] ) :

Adds a new firewall rule to the environment layer (node group).

URL

https://[hoster-api-host]/1.0/environment/security/rest/addrule

Parameters

  • envName : “string”

    target environment name.

  • session : “string”
  • rule : “json”

    JSON object with a new firewall rule:

    {
       "action": "DENY(0) | ALLOW(1)",
       "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
       "dst": "string",
       "isEnabled": "boolean",
       "isInfra": "boolean",
       "name": "string",
       "ports": "string",
       "priority": "int",
       "protocol": "string",
       "relatedEnvName": "string",
       "relatedSoftNodeGroup": "string",
       "softNodeGroup": "string",
       "src": "string"
    }
  • nodeGroup : “string” (optional)

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

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/addrule?envName=[string]&session=[string]&rule=[json]&nodeGroup=[string]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "action": "DENY(0) | ALLOW(1)",
          "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
          "dst": "string",
          "isEnabled": "boolean",
          "isInfra": "boolean",
          "name": "string",
          "ports": "string",
          "priority": "int",
          "protocol": "string",
          "relatedEnvName": "string",
          "relatedSoftNodeGroup": "string",
          "softNodeGroup": "string",
          "src": "string"
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

AddRules (envName, session, rules, [nodeGroup] ) :

Adds new firewall rules to the environment layer (node group).

URL

https://[hoster-api-host]/1.0/environment/security/rest/addrules

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • rules : “string”

    JSON object with an array of added firewall rules.

  • nodeGroup : “string” (optional)

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

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/addrules?envName=[string]&session=[string]&rules=[string]&nodeGroup=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "action": "DENY(0) | ALLOW(1)",
             "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
             "dst": "string",
             "isEnabled": "boolean",
             "isInfra": "boolean",
             "name": "string",
             "ports": "string",
             "priority": "int",
             "protocol": "string",
             "relatedEnvName": "string",
             "relatedSoftNodeGroup": "string",
             "softNodeGroup": "string",
             "src": "string"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

EditRule (envName, session, rule ) :

Applies changes to the existing firewall rule.

URL

https://[hoster-api-host]/1.0/environment/security/rest/editrule,

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • rule : “json”

    JSON object with a changed firewall rule.

    {
       "action": "DENY(0) | ALLOW(1)",
       "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
       "dst": "string",
       "isEnabled": "boolean",
       "isInfra": "boolean",
       "name": "string",
       "ports": "string",
       "priority": "int",
       "protocol": "string",
       "relatedEnvName": "string",
       "relatedSoftNodeGroup": "string",
       "softNodeGroup": "string",
       "src": "string"
    }

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/editrule?envName=[string]&session=[string]&rule=[json]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": {
          "action": "DENY(0) | ALLOW(1)",
          "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
          "dst": "string",
          "isEnabled": "boolean",
          "isInfra": "boolean",
          "name": "string",
          "ports": "string",
          "priority": "int",
          "protocol": "string",
          "relatedEnvName": "string",
          "relatedSoftNodeGroup": "string",
          "softNodeGroup": "string",
          "src": "string"
       },
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

GetRules (envName, session, [nodeGroup], ) :

Returns information about firewall rules for the environment.

URL

https://[hoster-api-host]/1.0/environment/security/rest/getrules

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeGroup : “string” (optional)

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

  • direction : “string” (optional)

    filters returned list to show just inbound (INPUT or IN) or outbound (OUTPUT or OUT) rules

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/getrules?envName=[string]&session=[string]&nodeGroup=[string]&direction=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "action": "DENY(0) | ALLOW(1)",
             "direction": "INPUT(0) | OUTPUT(1) | BIDIRECTIONAL(2)",
             "dst": "string",
             "isEnabled": "boolean",
             "isInfra": "boolean",
             "name": "string",
             "ports": "string",
             "priority": "int",
             "protocol": "string",
             "relatedEnvName": "string",
             "relatedSoftNodeGroup": "string",
             "softNodeGroup": "string",
             "src": "string"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveRule (envName, session, id ) :

Removes the existing firewall rule.

URL

https://[hoster-api-host]/1.0/environment/security/rest/removerule

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    Unique identifier of the target firewall rule.

Example

Method: POST

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

Response

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

RemoveRules (envName, session, ids ) :

Removes existing firewall rules.

URL

https://[hoster-api-host]/1.0/environment/security/rest/removerules

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • ids : “list”

    a comma- or semicolon-separated list of unique identifiers of the target firewall rules.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/removerules?envName=[string]&session=[string]&ids=[list]

Response

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

SetFirewallEnabled (envName, session, enabled ) :

Enables or disables a firewall feature for the specific environment.

URL

https://[hoster-api-host]/1.0/environment/security/rest/setfirewallenabled

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • enabled : “boolean”

    defines whether to enable (true) or disable (false) the environment firewall feature.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/setfirewallenabled?envName=[string]&session=[string]&enabled=[boolean]

Response

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

SetRuleEnabled (envName, session, id, enabled ) :

Enables or disables a specific firewall rule.

URL

https://[hoster-api-host]/1.0/environment/security/rest/setruleenabled

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • id : “int”

    unique identifier of the target firewall rule.

  • enabled : “boolean”

    defines whether to enable (true) or disable (false) the target firewall rule.

Example

Method: POST

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

Response

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

SetRules (envName, session, rules, [nodeGroup] ) :

Replaces all existing rules with new ones.

URL

https://[hoster-api-host]/1.0/environment/security/rest/setrules

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • rules : “string”

    JSON object with an array of firewall rules to be set instead of the existing ones.

  • nodeGroup : “string” (optional)

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

Example

Method: POST

https://[hoster-api-host]/1.0/environment/security/rest/setrules?envName=[string]&session=[string]&rules=[string]&nodeGroup=[string]

Response

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

Leave a Comment