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 ( |
Fields | |
---|---|
name |
Identifier. The name of the attribute in the API Hub. Format: |
displayName |
Required. The display name of the attribute. |
description |
Optional. The description of the attribute. |
definitionType |
Output only. The definition type of the attribute. |
scope |
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked. |
dataType |
Required. The type of the data of the attribute. |
allowedValues[] |
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 |
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 |
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 |
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: |
updateTime |
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: |
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 a user defined attribute. |
|
Delete an attribute. |
|
Get details about the attribute. |
|
List all attributes. |
|
Update the attribute. |