Agent Platform API . projects . locations . semanticGovernancePolicies

Instance Methods

operations()

Returns the operations Resource.

close()

Close httplib2 connections.

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

Creates a SemanticGovernancePolicy.

delete(name, etag=None, x__xgafv=None)

Deletes a SemanticGovernancePolicy.

get(name, x__xgafv=None)

Gets a SemanticGovernancePolicy.

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

Lists SemanticGovernancePolicies in a given location.

list_next()

Retrieves the next page of results.

patch(name, body=None, updateMask=None, x__xgafv=None)

Updates a SemanticGovernancePolicy.

Method Details

close()
Close httplib2 connections.
create(parent, body=None, semanticGovernancePolicyId=None, x__xgafv=None)
Creates a SemanticGovernancePolicy.

Args:
  parent: string, Required. The resource name of the Location into which to create the SemanticGovernancePolicy. Format: `projects/{project}/locations/{location}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a governance policy applied to a specific Agent and optionally a specific Tool within that Agent.
  "agent": "A String", # Required. The name of the agent in Agent Registry that is affected by this policy.
  "agentIdentity": "A String", # Output only. Represents the principal of the agent, used by the Policy Decision Point (PDP) for governance checks. For more information, see https://docs.cloud.google.com/agent-builder/agent-engine/agent-identity Format: `principal://TRUST_DOMAIN/NAMESPACE/AGENT_NAME` Example: `principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/AGENT_ENGINE_ID`
  "createTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was created.
  "description": "A String", # Optional. The description of the SemanticGovernancePolicy.
  "displayName": "A String", # Optional. The user-defined name of the SemanticGovernancePolicy.
  "etag": "A String", # Optional. Used to perform consistent read-modify-write transactions. If provided, the request will only succeed if the etag matches the current value. Otherwise, an ABORTED error will be returned.
  "mcpTools": [ # Optional. The McpTools that are affected by this policy.
    { # Represents a governance policy applied to MCP tools used by an Agent.
      "mcpServer": "A String", # Required. The resource name of the McpServer in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`
      "tools": [ # Optional. The resource names of the McpTools used by the Agent that is affected by this policy. If not specified, the policy applies to all McpTools in the McpServer.
        "A String",
      ],
    },
  ],
  "name": "A String", # Identifier. Resource name of the SemanticGovernancePolicy.
  "naturalLanguageConstraint": "A String", # Required. The natural language constraint of the SemanticGovernancePolicy.
  "updateTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was last updated.
}

  semanticGovernancePolicyId: string, Required. The ID to use for the SemanticGovernancePolicy, which will become the final component of the SemanticGovernancePolicy's resource name. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character cannot be a number or hyphen. The last character must be a letter or a number.
  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.
  },
}
delete(name, etag=None, x__xgafv=None)
Deletes a SemanticGovernancePolicy.

Args:
  name: string, Required. The name of the SemanticGovernancePolicy resource to be deleted. Format: `projects/{project}/locations/{location}/semanticGovernancePolicies/{semantic_governance_policy}` (required)
  etag: string, Optional. The etag of the SemanticGovernancePolicy. If an etag is provided and does not match the current etag of the SemanticGovernancePolicy, deletion will be blocked and an ABORTED error will be returned.
  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 a SemanticGovernancePolicy.

Args:
  name: string, Required. The name of the SemanticGovernancePolicy resource. Format: `projects/{project}/locations/{location}/semanticGovernancePolicies/{semantic_governance_policy}` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a governance policy applied to a specific Agent and optionally a specific Tool within that Agent.
  "agent": "A String", # Required. The name of the agent in Agent Registry that is affected by this policy.
  "agentIdentity": "A String", # Output only. Represents the principal of the agent, used by the Policy Decision Point (PDP) for governance checks. For more information, see https://docs.cloud.google.com/agent-builder/agent-engine/agent-identity Format: `principal://TRUST_DOMAIN/NAMESPACE/AGENT_NAME` Example: `principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/AGENT_ENGINE_ID`
  "createTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was created.
  "description": "A String", # Optional. The description of the SemanticGovernancePolicy.
  "displayName": "A String", # Optional. The user-defined name of the SemanticGovernancePolicy.
  "etag": "A String", # Optional. Used to perform consistent read-modify-write transactions. If provided, the request will only succeed if the etag matches the current value. Otherwise, an ABORTED error will be returned.
  "mcpTools": [ # Optional. The McpTools that are affected by this policy.
    { # Represents a governance policy applied to MCP tools used by an Agent.
      "mcpServer": "A String", # Required. The resource name of the McpServer in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`
      "tools": [ # Optional. The resource names of the McpTools used by the Agent that is affected by this policy. If not specified, the policy applies to all McpTools in the McpServer.
        "A String",
      ],
    },
  ],
  "name": "A String", # Identifier. Resource name of the SemanticGovernancePolicy.
  "naturalLanguageConstraint": "A String", # Required. The natural language constraint of the SemanticGovernancePolicy.
  "updateTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was last updated.
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists SemanticGovernancePolicies in a given location.

Args:
  parent: string, Required. The resource name of the Location from which to list the SemanticGovernancePolicies. Format: `projects/{project}/locations/{location}` (required)
  pageSize: integer, Optional. The list page size. If zero, a default page size of 10 is used.
  pageToken: string, Optional. The standard list page token.
  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 SemanticGovernancePolicyService.ListSemanticGovernancePolicies.
  "nextPageToken": "A String", # A token to retrieve the next page of results. Pass to ListSemanticGovernancePoliciesRequest.page_token to obtain that page.
  "semanticGovernancePolicies": [ # The list of SemanticGovernancePolicies.
    { # Represents a governance policy applied to a specific Agent and optionally a specific Tool within that Agent.
      "agent": "A String", # Required. The name of the agent in Agent Registry that is affected by this policy.
      "agentIdentity": "A String", # Output only. Represents the principal of the agent, used by the Policy Decision Point (PDP) for governance checks. For more information, see https://docs.cloud.google.com/agent-builder/agent-engine/agent-identity Format: `principal://TRUST_DOMAIN/NAMESPACE/AGENT_NAME` Example: `principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/AGENT_ENGINE_ID`
      "createTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was created.
      "description": "A String", # Optional. The description of the SemanticGovernancePolicy.
      "displayName": "A String", # Optional. The user-defined name of the SemanticGovernancePolicy.
      "etag": "A String", # Optional. Used to perform consistent read-modify-write transactions. If provided, the request will only succeed if the etag matches the current value. Otherwise, an ABORTED error will be returned.
      "mcpTools": [ # Optional. The McpTools that are affected by this policy.
        { # Represents a governance policy applied to MCP tools used by an Agent.
          "mcpServer": "A String", # Required. The resource name of the McpServer in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`
          "tools": [ # Optional. The resource names of the McpTools used by the Agent that is affected by this policy. If not specified, the policy applies to all McpTools in the McpServer.
            "A String",
          ],
        },
      ],
      "name": "A String", # Identifier. Resource name of the SemanticGovernancePolicy.
      "naturalLanguageConstraint": "A String", # Required. The natural language constraint of the SemanticGovernancePolicy.
      "updateTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was last updated.
    },
  ],
}
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.
        
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a SemanticGovernancePolicy.

Args:
  name: string, Identifier. Resource name of the SemanticGovernancePolicy. (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a governance policy applied to a specific Agent and optionally a specific Tool within that Agent.
  "agent": "A String", # Required. The name of the agent in Agent Registry that is affected by this policy.
  "agentIdentity": "A String", # Output only. Represents the principal of the agent, used by the Policy Decision Point (PDP) for governance checks. For more information, see https://docs.cloud.google.com/agent-builder/agent-engine/agent-identity Format: `principal://TRUST_DOMAIN/NAMESPACE/AGENT_NAME` Example: `principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/AGENT_ENGINE_ID`
  "createTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was created.
  "description": "A String", # Optional. The description of the SemanticGovernancePolicy.
  "displayName": "A String", # Optional. The user-defined name of the SemanticGovernancePolicy.
  "etag": "A String", # Optional. Used to perform consistent read-modify-write transactions. If provided, the request will only succeed if the etag matches the current value. Otherwise, an ABORTED error will be returned.
  "mcpTools": [ # Optional. The McpTools that are affected by this policy.
    { # Represents a governance policy applied to MCP tools used by an Agent.
      "mcpServer": "A String", # Required. The resource name of the McpServer in Agent Registry that is affected by this policy. Format: `projects/{project}/locations/{location}/mcpServers/{mcp_server}`
      "tools": [ # Optional. The resource names of the McpTools used by the Agent that is affected by this policy. If not specified, the policy applies to all McpTools in the McpServer.
        "A String",
      ],
    },
  ],
  "name": "A String", # Identifier. Resource name of the SemanticGovernancePolicy.
  "naturalLanguageConstraint": "A String", # Required. The natural language constraint of the SemanticGovernancePolicy.
  "updateTime": "A String", # Output only. Timestamp when this SemanticGovernancePolicy was last updated.
}

  updateMask: string, Optional. `update_mask` is used to specify the fields to be overwritten in the SemanticGovernancePolicy resource by the update. The fields specified in the `update_mask` are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the mask is not present, then all fields that are populated in the request message will be overwritten. Set the `update_mask` to `*` to override all fields.
  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.
  },
}