Close httplib2 connections.
generate(scope, body=None, x__xgafv=None)
Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.
Gets the full metadata and findings for an audit report.
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists the audit reports for the organization, folder, or project that you specify as the parent scope.
list_next(previous_request, previous_response)
Retrieves the next page of results.
close()
Close httplib2 connections.
generate(scope, body=None, x__xgafv=None)
Registers audit report generation requests. This method returns the operation identifier that you can use to track the report generation progress.
Args:
scope: string, Required. Organization, folder, or project that the audit applies to, in one of the following formats: * `projects/{project}/locations/{location}` * `folders/{folder}/locations/{location}` * `organizations/{organization}/locations/{location}` (required)
body: object, The request body.
The object takes the form of:
{ # Request message for GenerateAuditReport.
"complianceFramework": "A String", # Required. The framework that's used for the audit report. For example, `NIST_800_53`.
"complianceStandard": "A String", # Optional. Deprecated. Compliance standard for the audit report. Use the `compliance_framework` field instead.
"gcsUri": "A String", # URL for the Cloud Storage bucket where the report and evidence is uploaded. You must select a bucket that was provided during the enrollment process.
"reportFormat": "A String", # Required. Format for the audit report.
"validateOnly": True or False, # Optional. If `true`, only validates the request and does not generate the audit report. This executes standard request validation (such as schema, framework existence, scope, and IAM checks) and skips the apply phase. Use this field for the following purposes: * **Infrastructure as Code (IaC)**: Allow tools like Terraform to run dry-run mutations (e.g., `terraform plan`) without creating real resources or incurring costs. * **User Interface Validation**: Enable real-time form and permission validation in custom UIs before submitting requests. * **CI/CD & Automation**: Test your scripts, permissions, and parameters safely without triggering expensive Long-Running Operations (LROs) or consuming resource quotas.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
get(name, x__xgafv=None)
Gets the full metadata and findings for an audit report.
Args:
name: string, Required. Name of the audit report, in one of the following formats: * `projects/{project}/locations/{location}/auditReports/{audit_report}` * `folders/{folder}/locations/{location}/auditReports/{audit_report}` * `organizations/{organization}/locations/{location}/auditReports/{audit_report}` (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # An audit report.
"complianceFramework": "A String", # Output only. Compliance framework to use for the audit report. For example, `CIS_GCP_FOUNDATIONS_V1_2_0`.
"complianceStandard": "A String", # Output only. Deprecated. Compliance standard to be audited against. Use the `compliance_framework` field instead.
"controlDetails": [ # Output only. Overall status of the controls.
{ # Evaluation details for a control.
"complianceState": "A String", # Output only. Overall status of the findings for the control.
"control": { # A control. # Control that the findings are being reported for.
"controlFamily": { # Regulatory family of the control. # Output only. Regulatory family of the control.
"displayName": "A String", # Display name of the regulatory control family.
"familyId": "A String", # ID of the regulatory control family. To find the list of supported control families, use the ListControls method and review the `control_family` field in the response.
},
"customerResponsibilityDescription": "A String", # Output only. A description of your responsibility for this control.
"customerResponsibilityImplementation": "A String", # Output only. A description of how you can implement your responsibility for this control.
"description": "A String", # Output only. Description of the control.
"displayName": "A String", # Output only. Display name of the control.
"family": "A String", # Output only. Category that the control belongs to.
"googleResponsibilityDescription": "A String", # Output only. A description of Google's responsibility for this control.
"googleResponsibilityImplementation": "A String", # Output only. A description of how Google implements its responsibility for this control.
"id": "A String", # Output only. Control identifier that's used to fetch the findings. The identifier is the same as the control report name.
"responsibilityType": "A String", # Output only. Who is responsible for implementing this control. Set to one of the following values: `GOOGLE`, `CUSTOMER`, or `SHARED`.
},
"controlReportSummary": { # Additional information about the number of checks that were made during an audit operation. # A control report summary that provides a high-level overview of the compliance controls and the assessment status.
"compliantCount": 42, # Number of compliant checks.
"errorCount": 42, # Number of checks that can't be performed due to errors.
"manualReviewNeededCount": 42, # Number of checks that require a manual review.
"totalCount": 42, # Total number of evaluated checks.
"violationCount": 42, # Number of checks with violations.
},
},
],
"createTime": "A String", # Output only. Creation time of the audit report.
"destinationDetails": { # Cloud Storage bucket where the audit report is uploaded to. # Output only. Cloud Storage bucket where the audit report is uploaded to.
"gcsBucketUri": "A String", # URI for the Cloud Storage bucket, in the format `gs://{bucket_name}`.
},
"name": "A String", # Identifier. Name of the audit report, in one of the following formats: * `projects/{project}/locations/{location}/auditReports/{audit_report}` * `folders/{folder}/locations/{location}/auditReports/{audit_report}` * `organizations/{organization}/locations/{location}/auditReports/{audit_report}`
"operationId": "A String", # Output only. Client operation ID for the audit report.
"reportGenerationState": "A String", # Output only. State of audit report generation.
"reportSummary": { # Additional information about the number of checks that were made during an audit operation. # Output only. Report summary that includes information about compliance and violation counts.
"compliantCount": 42, # Number of compliant checks.
"errorCount": 42, # Number of checks that can't be performed due to errors.
"manualReviewNeededCount": 42, # Number of checks that require a manual review.
"totalCount": 42, # Total number of evaluated checks.
"violationCount": 42, # Number of checks with violations.
},
"scope": "A String", # Output only. Organization, folder, or project that the report is generated for, in one of the following formats: * `projects/{project}/locations/{location}` * `folders/{folder}/locations/{location}` * `organizations/{organization}/locations/{location}`
"scopeId": "A String", # Output only. Project number, folder ID, or organization ID that the audit report was generated for.
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists the audit reports for the organization, folder, or project that you specify as the parent scope.
Args:
parent: string, Required. Parent organization, folder, or project to list reports for, in one of the following formats: * `projects/{project}/locations/{location}` * `folders/{folder}/locations/{location}` * `organizations/{organization}/locations/{location}` (required)
pageSize: integer, Optional. Maximum number of items to return in a single page. The service might return fewer items than this value. If unspecified, the service picks an appropriate default. The maximum value is 100; values above 100 are reduced to 100.
pageToken: string, Optional. A page token, received from a previous call, to retrieve the next page of results.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for ListAuditReports.
"auditReports": [ # Output only. Audit reports.
{ # An audit report.
"complianceFramework": "A String", # Output only. Compliance framework to use for the audit report. For example, `CIS_GCP_FOUNDATIONS_V1_2_0`.
"complianceStandard": "A String", # Output only. Deprecated. Compliance standard to be audited against. Use the `compliance_framework` field instead.
"controlDetails": [ # Output only. Overall status of the controls.
{ # Evaluation details for a control.
"complianceState": "A String", # Output only. Overall status of the findings for the control.
"control": { # A control. # Control that the findings are being reported for.
"controlFamily": { # Regulatory family of the control. # Output only. Regulatory family of the control.
"displayName": "A String", # Display name of the regulatory control family.
"familyId": "A String", # ID of the regulatory control family. To find the list of supported control families, use the ListControls method and review the `control_family` field in the response.
},
"customerResponsibilityDescription": "A String", # Output only. A description of your responsibility for this control.
"customerResponsibilityImplementation": "A String", # Output only. A description of how you can implement your responsibility for this control.
"description": "A String", # Output only. Description of the control.
"displayName": "A String", # Output only. Display name of the control.
"family": "A String", # Output only. Category that the control belongs to.
"googleResponsibilityDescription": "A String", # Output only. A description of Google's responsibility for this control.
"googleResponsibilityImplementation": "A String", # Output only. A description of how Google implements its responsibility for this control.
"id": "A String", # Output only. Control identifier that's used to fetch the findings. The identifier is the same as the control report name.
"responsibilityType": "A String", # Output only. Who is responsible for implementing this control. Set to one of the following values: `GOOGLE`, `CUSTOMER`, or `SHARED`.
},
"controlReportSummary": { # Additional information about the number of checks that were made during an audit operation. # A control report summary that provides a high-level overview of the compliance controls and the assessment status.
"compliantCount": 42, # Number of compliant checks.
"errorCount": 42, # Number of checks that can't be performed due to errors.
"manualReviewNeededCount": 42, # Number of checks that require a manual review.
"totalCount": 42, # Total number of evaluated checks.
"violationCount": 42, # Number of checks with violations.
},
},
],
"createTime": "A String", # Output only. Creation time of the audit report.
"destinationDetails": { # Cloud Storage bucket where the audit report is uploaded to. # Output only. Cloud Storage bucket where the audit report is uploaded to.
"gcsBucketUri": "A String", # URI for the Cloud Storage bucket, in the format `gs://{bucket_name}`.
},
"name": "A String", # Identifier. Name of the audit report, in one of the following formats: * `projects/{project}/locations/{location}/auditReports/{audit_report}` * `folders/{folder}/locations/{location}/auditReports/{audit_report}` * `organizations/{organization}/locations/{location}/auditReports/{audit_report}`
"operationId": "A String", # Output only. Client operation ID for the audit report.
"reportGenerationState": "A String", # Output only. State of audit report generation.
"reportSummary": { # Additional information about the number of checks that were made during an audit operation. # Output only. Report summary that includes information about compliance and violation counts.
"compliantCount": 42, # Number of compliant checks.
"errorCount": 42, # Number of checks that can't be performed due to errors.
"manualReviewNeededCount": 42, # Number of checks that require a manual review.
"totalCount": 42, # Total number of evaluated checks.
"violationCount": 42, # Number of checks with violations.
},
"scope": "A String", # Output only. Organization, folder, or project that the report is generated for, in one of the following formats: * `projects/{project}/locations/{location}` * `folders/{folder}/locations/{location}` * `organizations/{organization}/locations/{location}`
"scopeId": "A String", # Output only. Project number, folder ID, or organization ID that the audit report was generated for.
},
],
"nextPageToken": "A String", # Output only. A token that you can send as the `page_token` in a subsequent request to retrieve the next page of results. If this field is empty, there are no subsequent pages.
}
list_next(previous_request, previous_response)
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.