Assured Workloads API . organizations . locations . workloads . violations

Instance Methods

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

Acknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.

close()

Close httplib2 connections.

get(name, x__xgafv=None)

Retrieves Assured Workload Violation based on ID.

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

Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format `organizations/{org_id}/locations/{location}/workloads/-`

list_next()

Retrieves the next page of results.

Method Details

acknowledge(name, body=None, x__xgafv=None)
Acknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.

Args:
  name: string, Required. The resource name of the Violation to acknowledge. Format: organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} (required)
  body: object, The request body.
    The object takes the form of:

{ # Request for acknowledging the violation
  "acknowledgeType": "A String", # Optional. Acknowledge type of specified violation.
  "comment": "A String", # Required. Business justification explaining the need for violation acknowledgement
  "nonCompliantOrgPolicy": "A String", # Optional. This field is deprecated and will be removed in future version of the API. Name of the OrgPolicy which was modified with non-compliant change and resulted in this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
}

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

Returns:
  An object of the form:

    { # Response for violation acknowledgement
}
close()
Close httplib2 connections.
get(name, x__xgafv=None)
Retrieves Assured Workload Violation based on ID.

Args:
  name: string, Required. The resource name of the Violation to fetch (ie. Violation.name). Format: organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Workload monitoring Violation.
  "acknowledged": True or False, # A boolean that indicates if the violation is acknowledged
  "acknowledgementTime": "A String", # Optional. Timestamp when this violation was acknowledged first. Check exception_contexts to find the last time the violation was acknowledged when there are more than one violations. This field will be absent when acknowledged field is marked as false.
  "associatedOrgPolicyViolationId": "A String", # Optional. Output only. Violation Id of the org-policy violation due to which the resource violation is caused. Empty for org-policy violations.
  "auditLogLink": "A String", # Output only. Immutable. Audit Log Link for violated resource Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
  "beginTime": "A String", # Output only. Time of the event which triggered the Violation.
  "category": "A String", # Output only. Category under which this violation is mapped. e.g. Location, Service Usage, Access, Encryption, etc.
  "description": "A String", # Output only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
  "exceptionAuditLogLink": "A String", # Output only. Immutable. Audit Log link to find business justification provided for violation exception. Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
  "exceptionContexts": [ # Output only. List of all the exception detail added for the violation.
    { # Violation exception detail.
      "acknowledgementTime": "A String", # Timestamp when the violation was acknowledged.
      "comment": "A String", # Business justification provided towards the acknowledgement of the violation.
      "userName": "A String", # Name of the user (or service account) who acknowledged the violation.
    },
  ],
  "name": "A String", # Output only. Immutable. Name of the Violation. Format: organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
  "nonCompliantOrgPolicy": "A String", # Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and resulted this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
  "orgPolicyConstraint": "A String", # Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in this violation.
  "parentProjectNumber": "A String", # Optional. Output only. Parent project number where resource is present. Empty for org-policy violations.
  "remediation": { # Represents remediation guidance to resolve compliance violation for AssuredWorkload # Output only. Compliance violation remediation
    "compliantValues": [ # Values that can resolve the violation For example: for list org policy violations, this will either be the list of allowed or denied values
      "A String",
    ],
    "instructions": { # Instructions to remediate violation # Required. Remediation instructions to resolve violations
      "consoleInstructions": { # Remediation instructions to resolve violation via cloud console # Remediation instructions to resolve violation via cloud console
        "additionalLinks": [ # Additional urls for more information about steps
          "A String",
        ],
        "consoleUris": [ # Link to console page where violations can be resolved
          "A String",
        ],
        "steps": [ # Steps to resolve violation via cloud console
          "A String",
        ],
      },
      "gcloudInstructions": { # Remediation instructions to resolve violation via gcloud cli # Remediation instructions to resolve violation via gcloud cli
        "additionalLinks": [ # Additional urls for more information about steps
          "A String",
        ],
        "gcloudCommands": [ # Gcloud command to resolve violation
          "A String",
        ],
        "steps": [ # Steps to resolve violation via gcloud cli
          "A String",
        ],
      },
    },
    "remediationType": "A String", # Output only. Reemediation type based on the type of org policy values violated
  },
  "resolveTime": "A String", # Output only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty.
  "resourceName": "A String", # Optional. Output only. Name of the resource like //storage.googleapis.com/myprojectxyz-testbucket. Empty for org-policy violations.
  "resourceType": "A String", # Optional. Output only. Type of the resource like compute.googleapis.com/Disk, etc. Empty for org-policy violations.
  "state": "A String", # Output only. State of the violation
  "updateTime": "A String", # Output only. The last time when the Violation record was updated.
  "violationType": "A String", # Output only. Type of the violation
}
list(parent, filter=None, interval_endTime=None, interval_startTime=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format `organizations/{org_id}/locations/{location}/workloads/-`

Args:
  parent: string, Required. The Workload name. Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. (required)
  filter: string, Optional. A custom filter for filtering by the Violations properties.
  interval_endTime: string, The end of the time window.
  interval_startTime: string, The start of the time window.
  pageSize: integer, Optional. Page size.
  pageToken: string, Optional. Page token returned from previous request.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response of ListViolations endpoint.
  "nextPageToken": "A String", # The next page token. Returns empty if reached the last page.
  "violations": [ # List of Violations under a Workload.
    { # Workload monitoring Violation.
      "acknowledged": True or False, # A boolean that indicates if the violation is acknowledged
      "acknowledgementTime": "A String", # Optional. Timestamp when this violation was acknowledged first. Check exception_contexts to find the last time the violation was acknowledged when there are more than one violations. This field will be absent when acknowledged field is marked as false.
      "associatedOrgPolicyViolationId": "A String", # Optional. Output only. Violation Id of the org-policy violation due to which the resource violation is caused. Empty for org-policy violations.
      "auditLogLink": "A String", # Output only. Immutable. Audit Log Link for violated resource Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
      "beginTime": "A String", # Output only. Time of the event which triggered the Violation.
      "category": "A String", # Output only. Category under which this violation is mapped. e.g. Location, Service Usage, Access, Encryption, etc.
      "description": "A String", # Output only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
      "exceptionAuditLogLink": "A String", # Output only. Immutable. Audit Log link to find business justification provided for violation exception. Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
      "exceptionContexts": [ # Output only. List of all the exception detail added for the violation.
        { # Violation exception detail.
          "acknowledgementTime": "A String", # Timestamp when the violation was acknowledged.
          "comment": "A String", # Business justification provided towards the acknowledgement of the violation.
          "userName": "A String", # Name of the user (or service account) who acknowledged the violation.
        },
      ],
      "name": "A String", # Output only. Immutable. Name of the Violation. Format: organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
      "nonCompliantOrgPolicy": "A String", # Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and resulted this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
      "orgPolicyConstraint": "A String", # Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in this violation.
      "parentProjectNumber": "A String", # Optional. Output only. Parent project number where resource is present. Empty for org-policy violations.
      "remediation": { # Represents remediation guidance to resolve compliance violation for AssuredWorkload # Output only. Compliance violation remediation
        "compliantValues": [ # Values that can resolve the violation For example: for list org policy violations, this will either be the list of allowed or denied values
          "A String",
        ],
        "instructions": { # Instructions to remediate violation # Required. Remediation instructions to resolve violations
          "consoleInstructions": { # Remediation instructions to resolve violation via cloud console # Remediation instructions to resolve violation via cloud console
            "additionalLinks": [ # Additional urls for more information about steps
              "A String",
            ],
            "consoleUris": [ # Link to console page where violations can be resolved
              "A String",
            ],
            "steps": [ # Steps to resolve violation via cloud console
              "A String",
            ],
          },
          "gcloudInstructions": { # Remediation instructions to resolve violation via gcloud cli # Remediation instructions to resolve violation via gcloud cli
            "additionalLinks": [ # Additional urls for more information about steps
              "A String",
            ],
            "gcloudCommands": [ # Gcloud command to resolve violation
              "A String",
            ],
            "steps": [ # Steps to resolve violation via gcloud cli
              "A String",
            ],
          },
        },
        "remediationType": "A String", # Output only. Reemediation type based on the type of org policy values violated
      },
      "resolveTime": "A String", # Output only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty.
      "resourceName": "A String", # Optional. Output only. Name of the resource like //storage.googleapis.com/myprojectxyz-testbucket. Empty for org-policy violations.
      "resourceType": "A String", # Optional. Output only. Type of the resource like compute.googleapis.com/Disk, etc. Empty for org-policy violations.
      "state": "A String", # Output only. State of the violation
      "updateTime": "A String", # Output only. The last time when the Violation record was updated.
      "violationType": "A String", # Output only. Type of the violation
    },
  ],
}
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.