Artifact Registry API . projects . locations . repositories . rules

Instance Methods

close()

Close httplib2 connections.

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

Creates a rule.

delete(name, x__xgafv=None)

Deletes a rule.

get(name, x__xgafv=None)

Gets a rule.

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

Lists rules.

list_next()

Retrieves the next page of results.

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

Updates a rule.

Method Details

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

Args:
  parent: string, Required. The name of the parent resource where the rule will be created. (required)
  body: object, The request body.
    The object takes the form of:

{ # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
  "action": "A String", # The action this rule makes.
  "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
    "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
    "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  },
  "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
  "operation": "A String",
  "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
}

  ruleId: string, The rule id to use for this repository.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
  "action": "A String", # The action this rule makes.
  "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
    "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
    "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  },
  "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
  "operation": "A String",
  "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
}
delete(name, x__xgafv=None)
Deletes a rule.

Args:
  name: string, Required. The name of the rule to delete. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
get(name, x__xgafv=None)
Gets a rule.

Args:
  name: string, Required. The name of the rule to retrieve. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
  "action": "A String", # The action this rule makes.
  "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
    "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
    "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  },
  "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
  "operation": "A String",
  "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
}
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Lists rules.

Args:
  parent: string, Required. The name of the parent repository whose rules will be listed. For example: `projects/p1/locations/us-central1/repositories/repo1`. (required)
  pageSize: integer, The maximum number of rules to return. Maximum page size is 1,000.
  pageToken: string, The next_page_token value returned from a previous list request, if any.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The response from listing rules.
  "nextPageToken": "A String", # The token to retrieve the next page of rules, or empty if there are no more rules to return.
  "rules": [ # The rules returned.
    { # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
      "action": "A String", # The action this rule makes.
      "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
        "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
        "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
        "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
        "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
      },
      "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
      "operation": "A String",
      "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
    },
  ],
}
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 rule.

Args:
  name: string, The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1". (required)
  body: object, The request body.
    The object takes the form of:

{ # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
  "action": "A String", # The action this rule makes.
  "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
    "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
    "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  },
  "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
  "operation": "A String",
  "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
}

  updateMask: string, The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Rule applies to repository or package level. It defines the deny or allow action of the operation when the conditions in the rule are met.
  "action": "A String", # The action this rule makes.
  "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # Optional. The condition of the rule in CEL expression. If not provided, the rule matches all the objects.
    "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
    "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
    "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
    "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
  },
  "name": "A String", # The name of the rule, for example: "projects/p1/locations/us-central1/repositories/repo1/rules/rule1".
  "operation": "A String",
  "packageId": "A String", # The package ID the rule applies to. If empty, this rule applies to all the packages inside the repository.
}