REST Resource: projects.locations.attributes

Resource: Attribute

An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users.

JSON representation
{
  "name": string,
  "displayName": string,
  "description": string,
  "definitionType": enum (DefinitionType),
  "scope": enum (Scope),
  "dataType": enum (DataType),
  "allowedValues": [
    {
      object (AllowedValue)
    }
  ],
  "cardinality": integer,
  "mandatory": boolean,
  "createTime": string,
  "updateTime": string
}
Fields
name

string

Identifier. The name of the attribute in the API Hub.

Format: projects/{project}/locations/{location}/attributes/{attribute}

displayName

string

Required. The display name of the attribute.

description

string

Optional. The description of the attribute.

definitionType

enum (DefinitionType)

Output only. The definition type of the attribute.

scope

enum (Scope)

Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.

dataType

enum (DataType)

Required. The type of the data of the attribute.

allowedValues[]

object (AllowedValue)

Optional. The list of allowed values when the attribute value is of type enum. This is required when the dataType of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.

cardinality

integer

Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.

mandatory

boolean

Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.

createTime

string (Timestamp format)

Output only. The time at which the attribute was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The time at which the attribute was last updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

DefinitionType

Enumeration of attribute definition types.

Enums
DEFINITION_TYPE_UNSPECIFIED Attribute definition type unspecified.
SYSTEM_DEFINED The attribute is predefined by the API Hub. Note that only the list of allowed values can be updated in this case via attributes.patch method.
USER_DEFINED The attribute is defined by the user.

Scope

Enumeration for the scope of the attribute representing the resource in the API Hub to which the attribute can be linked.

Enums
SCOPE_UNSPECIFIED Scope Unspecified.
API Attribute can be linked to an API.
VERSION Attribute can be linked to an API version.
SPEC Attribute can be linked to a Spec.
API_OPERATION Attribute can be linked to an API Operation.
DEPLOYMENT Attribute can be linked to a Deployment.
DEPENDENCY Attribute can be linked to a Dependency.
DEFINITION Attribute can be linked to a definition.
EXTERNAL_API Attribute can be linked to a ExternalAPI.
PLUGIN Attribute can be linked to a Plugin.

DataType

Enumeration of attribute's data type.

Enums
DATA_TYPE_UNSPECIFIED Attribute data type unspecified.
ENUM Attribute's value is of type enum.
JSON Attribute's value is of type json.
STRING Attribute's value is of type string.

Methods

create

Create a user defined attribute.

delete

Delete an attribute.

get

Get details about the attribute.

list

List all attributes.

patch

Update the attribute.