Apigee API . organizations . environments . securityActions

Instance Methods

close()

Close httplib2 connections.

create(parent, body=None, securityActionId=None, x__xgafv=None)

CreateSecurityAction creates a SecurityAction.

disable(name, body=None, x__xgafv=None)

Disable a SecurityAction. The `state` of the SecurityAction after disabling is `DISABLED`. `DisableSecurityAction` can be called on SecurityActions in the state `ENABLED`; SecurityActions in a different state (including `DISABLED`) return an error.

enable(name, body=None, x__xgafv=None)

Enable a SecurityAction. The `state` of the SecurityAction after enabling is `ENABLED`. `EnableSecurityAction` can be called on SecurityActions in the state `DISABLED`; SecurityActions in a different state (including `ENABLED) return an error.

get(name, x__xgafv=None)

Get a SecurityAction by name.

list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)

Returns a list of SecurityActions. This returns both enabled and disabled actions.

list_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
create(parent, body=None, securityActionId=None, x__xgafv=None)
CreateSecurityAction creates a SecurityAction.

Args:
  parent: string, Required. The organization and environment that this SecurityAction applies to. Format: organizations/{org}/environments/{env} (required)
  body: object, The request body.
    The object takes the form of:

{ # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
  "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
  },
  "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
    "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
      "A String",
    ],
    "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
      "A String",
    ],
  },
  "createTime": "A String", # Output only. The create time for this SecurityAction.
  "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
    "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
  },
  "description": "A String", # Optional. An optional user provided description of the SecurityAction.
  "expireTime": "A String", # The expiration for this SecurityAction.
  "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
    "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
      { # An HTTP header.
        "name": "A String", # The header name to be sent to the target.
        "value": "A String", # The header value to be sent to the target.
      },
    ],
  },
  "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
  "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
  "ttl": "A String", # Input only. The TTL for this SecurityAction.
  "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
}

  securityActionId: string, Required. The ID to use for the SecurityAction, which will become the final component of the action's resource name. This value should be 0-61 characters, and valid format is (^[a-z]([a-z0-9-]{​0,61}[a-z0-9])?$).
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
  "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
  },
  "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
    "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
      "A String",
    ],
    "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
      "A String",
    ],
  },
  "createTime": "A String", # Output only. The create time for this SecurityAction.
  "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
    "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
  },
  "description": "A String", # Optional. An optional user provided description of the SecurityAction.
  "expireTime": "A String", # The expiration for this SecurityAction.
  "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
    "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
      { # An HTTP header.
        "name": "A String", # The header name to be sent to the target.
        "value": "A String", # The header value to be sent to the target.
      },
    ],
  },
  "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
  "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
  "ttl": "A String", # Input only. The TTL for this SecurityAction.
  "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
}
disable(name, body=None, x__xgafv=None)
Disable a SecurityAction. The `state` of the SecurityAction after disabling is `DISABLED`. `DisableSecurityAction` can be called on SecurityActions in the state `ENABLED`; SecurityActions in a different state (including `DISABLED`) return an error.

Args:
  name: string, Required. The name of the SecurityAction to disable. Format: organizations/{org}/environments/{env}/securityActions/{security_action} (required)
  body: object, The request body.
    The object takes the form of:

{ # Message to disable an enabled SecurityAction.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
  "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
  },
  "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
    "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
      "A String",
    ],
    "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
      "A String",
    ],
  },
  "createTime": "A String", # Output only. The create time for this SecurityAction.
  "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
    "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
  },
  "description": "A String", # Optional. An optional user provided description of the SecurityAction.
  "expireTime": "A String", # The expiration for this SecurityAction.
  "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
    "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
      { # An HTTP header.
        "name": "A String", # The header name to be sent to the target.
        "value": "A String", # The header value to be sent to the target.
      },
    ],
  },
  "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
  "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
  "ttl": "A String", # Input only. The TTL for this SecurityAction.
  "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
}
enable(name, body=None, x__xgafv=None)
Enable a SecurityAction. The `state` of the SecurityAction after enabling is `ENABLED`. `EnableSecurityAction` can be called on SecurityActions in the state `DISABLED`; SecurityActions in a different state (including `ENABLED) return an error.

Args:
  name: string, Required. The name of the SecurityAction to enable. Format: organizations/{org}/environments/{env}/securityActions/{security_action} (required)
  body: object, The request body.
    The object takes the form of:

{ # Message to enable a disabled SecurityAction.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
  "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
  },
  "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
    "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
      "A String",
    ],
    "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
      "A String",
    ],
  },
  "createTime": "A String", # Output only. The create time for this SecurityAction.
  "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
    "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
  },
  "description": "A String", # Optional. An optional user provided description of the SecurityAction.
  "expireTime": "A String", # The expiration for this SecurityAction.
  "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
    "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
      { # An HTTP header.
        "name": "A String", # The header name to be sent to the target.
        "value": "A String", # The header value to be sent to the target.
      },
    ],
  },
  "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
  "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
  "ttl": "A String", # Input only. The TTL for this SecurityAction.
  "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
}
get(name, x__xgafv=None)
Get a SecurityAction by name.

Args:
  name: string, Required. The fully qualified name of the SecurityAction to retrieve. Format: organizations/{org}/environments/{env}/securityActions/{security_action} (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
  "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
  },
  "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
    "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
      "A String",
    ],
    "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
      "A String",
    ],
  },
  "createTime": "A String", # Output only. The create time for this SecurityAction.
  "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
    "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
  },
  "description": "A String", # Optional. An optional user provided description of the SecurityAction.
  "expireTime": "A String", # The expiration for this SecurityAction.
  "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
    "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
      { # An HTTP header.
        "name": "A String", # The header name to be sent to the target.
        "value": "A String", # The header value to be sent to the target.
      },
    ],
  },
  "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
  "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
  "ttl": "A String", # Input only. The TTL for this SecurityAction.
  "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
}
list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)
Returns a list of SecurityActions. This returns both enabled and disabled actions.

Args:
  parent: string, Required. The parent, which owns this collection of SecurityActions. Format: organizations/{org}/environments/{env} (required)
  filter: string, The filter expression to filter List results. https://google.aip.dev/160. Allows for filtering over: state and api_proxies. E.g.: state = ACTIVE AND apiProxies:foo. Filtering by action is not supported https://github.com/aip-dev/google.aip.dev/issues/624
  pageSize: integer, The maximum number of SecurityActions to return. If unspecified, at most 50 SecurityActions will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  pageToken: string, A page token, received from a previous `ListSecurityActions` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSecurityActions` must match the call that provided the page token.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Contains a list of SecurityActions in response to a ListSecurityActionRequest.
  "nextPageToken": "A String", # A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
  "securityActions": [ # The SecurityActions for the specified environment.
    { # A SecurityAction is rule that can be enforced at an environment level. The result is one of: - A denied API call - An explicitly allowed API call - A flagged API call (HTTP headers added before the target receives it) At least one condition is required to create a SecurityAction.
      "allow": { # Message that should be set in case of an Allow Action. This does not have any fields. # Allow a request through if it matches this SecurityAction.
      },
      "conditionConfig": { # The following are a list of conditions. A valid SecurityAction must contain at least one condition. Within a condition, each element is ORed. Across conditions elements are ANDed. For example if a SecurityAction has the following: api_keys: ["key1", "key2"] and developers: ["dev1", "dev2"] then this is interpreted as: enforce the action if the incoming request has ((api_key = "key1" OR api_key="key") AND (developer="dev1" OR developer="dev2")) # Required. A valid SecurityAction must contain at least one condition.
        "botReasons": [ # Optional. A list of Bot Reasons. Current options: Flooder, Brute Guessor, Static Content Scraper, OAuth Abuser, Robot Abuser, TorListRule, Advanced Anomaly Detection and Advanced API Scraper.
          "A String",
        ],
        "ipAddressRanges": [ # Optional. A list of IP addresses. This could be either IPv4 or IPv6. Limited to 100 per action.
          "A String",
        ],
      },
      "createTime": "A String", # Output only. The create time for this SecurityAction.
      "deny": { # Message that should be set in case of a Deny Action. # Deny a request through if it matches this SecurityAction.
        "responseCode": 42, # Optional. The HTTP response code if the Action = DENY.
      },
      "description": "A String", # Optional. An optional user provided description of the SecurityAction.
      "expireTime": "A String", # The expiration for this SecurityAction.
      "flag": { # The message that should be set in the case of a Flag action. # Flag a request through if it matches this SecurityAction.
        "headers": [ # Optional. A list of HTTP headers to be sent to the target in case of a FLAG SecurityAction. Limit 5 headers per SecurityAction. At least one is mandatory.
          { # An HTTP header.
            "name": "A String", # The header name to be sent to the target.
            "value": "A String", # The header value to be sent to the target.
          },
        ],
      },
      "name": "A String", # Immutable. This field is ignored during creation as per AIP-133. Please set the `security_action_id` field in the CreateSecurityActionRequest when creating a new SecurityAction. Format: organizations/{org}/environments/{env}/securityActions/{security_action}
      "state": "A String", # Required. Only an ENABLED SecurityAction is enforced. An ENABLED SecurityAction past its expiration time will not be enforced.
      "ttl": "A String", # Input only. The TTL for this SecurityAction.
      "updateTime": "A String", # Output only. The update time for this SecurityAction. This reflects when this SecurityAction changed states.
    },
  ],
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.