- NAME
-
- gcloud alpha apihub apis versions specs update - update specs
- SYNOPSIS
-
-
gcloud alpha apihub apis versions specs update(SPEC:--api=API--location=LOCATION--version=VERSION) [--display-name=DISPLAY_NAME] [--parsing-mode=PARSING_MODE] [--source-uri=SOURCE_URI] [--attributes=[ATTRIBUTES,…] |--update-attributes=[UPDATE_ATTRIBUTES,…]--clear-attributes|--remove-attributes=REMOVE_ATTRIBUTES] [--clear-contents--contents=CONTENTS--contents-mime-type=CONTENTS_MIME_TYPE] [--clear-documentation--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI] [--clear-lint-response--lint-response-create-time=LINT_RESPONSE_CREATE_TIME--lint-response-linter=LINT_RESPONSE_LINTER--lint-response-source=LINT_RESPONSE_SOURCE--lint-response-state=LINT_RESPONSE_STATE--lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY] |--add-lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY]--clear-lint-response-issues|--remove-lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY]--lint-response-summary=[count=COUNT],[severity=SEVERITY] |--add-lint-response-summary=[count=COUNT],[severity=SEVERITY]--clear-lint-response-summary|--remove-lint-response-summary=[count=COUNT],[severity=SEVERITY]] [--clear-spec-type--spec-type-json-values=[SPEC_TYPE_JSON_VALUES,…] |--spec-type-string-values=[SPEC_TYPE_STRING_VALUES,…] |--spec-type-uri-values=[SPEC_TYPE_URI_VALUES,…] |--spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE] |--add-spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]--clear-spec-type-enum-values|--remove-spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Update a spec - EXAMPLES
-
To update a spec with the ID
my-specfor versionmy-versionand APImy-api, run:gcloud alpha apihub apis versions specs update my-spec --version=my-version --api=my-api --display-name="New Spec Name" --project=my-project --location=us-central1 - POSITIONAL ARGUMENTS
-
-
Spec resource - Identifier. The name of the spec.
Format:
projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}The arguments in this group can be used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways.To set the
projectattribute:-
provide the argument
specon the command line with a fully specified name; -
provide the argument
--projecton the command line; -
set the property
core/project.
This must be specified.
SPEC-
ID of the spec or fully qualified identifier for the spec.
To set the
specattribute:-
provide the argument
specon the command line.
This positional argument must be specified if any of the other arguments in this group are specified.
-
provide the argument
--api=API-
The api id of the spec resource.
To set the
apiattribute:-
provide the argument
specon the command line with a fully specified name; -
provide the argument
--apion the command line.
-
provide the argument
--location=LOCATION-
The location id of the spec resource.
To set the
locationattribute:-
provide the argument
specon the command line with a fully specified name; -
provide the argument
--locationon the command line.
-
provide the argument
--version=VERSION-
The version id of the spec resource.
To set the
versionattribute:-
provide the argument
specon the command line with a fully specified name; -
provide the argument
--versionon the command line.
-
provide the argument
-
provide the argument
-
Spec resource - Identifier. The name of the spec.
- FLAGS
-
--display-name=DISPLAY_NAME- The display name of the spec. This can contain the file name of the spec.
--parsing-mode=PARSING_MODE-
Enum specifying the parsing mode for OpenAPI Specification (OAS) parsing.
PARSING_MODEmust be one of:relaxed- Parsing of the Spec on create and update is relaxed, meaning that parsing errors the spec contents will not fail the API call.
strict- Parsing of the Spec on create and update is strict, meaning that parsing errors in the spec contents will fail the API call.
--source-uri=SOURCE_URI- The URI of the spec source in case file is uploaded from an external version control system.
-
Update attributes.
At most one of these can be specified:
--attributes=[ATTRIBUTES,…]-
Set attributes to new value. The list of user defined attributes associated with
the spec. The key is the attribute name. It will be of the format:
projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource.KEY-
Sets
KEYvalue. VALUE-
Sets
VALUEvalue.enumValues-
The attribute values associated with a resource in case attribute data type is
enum.
values-
The attribute values in case attribute data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
jsonValues-
The attribute values associated with a resource in case attribute data type is
JSON.
values- The attribute values in case attribute data type is string or JSON.
stringValues-
The attribute values associated with a resource in case attribute data type is
string.
values- The attribute values in case attribute data type is string or JSON.
uriValues-
The attribute values associated with a resource in case attribute data type is
URL, URI or IP, like gs://bucket-name/object-name.
values- The attribute values in case attribute data type is string or JSON.
Shorthand Example:--attributes=string={enumValues={values=[{description=string,displayName=string,id=string,immutable=boolean}]},jsonValues={values=[string]},stringValues={values=[string]},uriValues={values=[string]}}
JSON Example:--attributes='{"string": {"enumValues": {"values": [{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]}, "jsonValues": {"values": ["string"]}, "stringValues": {"values": ["string"]}, "uriValues": {"values": ["string"]}}}'
File Example:--attributes=path_to_file.(yaml|json)
-
Or at least one of these can be specified:
--update-attributes=[UPDATE_ATTRIBUTES,…]-
Update attributes value or add key value pair. The list of user defined
attributes associated with the spec. The key is the attribute name. It will be
of the format:
projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource.KEY-
Sets
KEYvalue. VALUE-
Sets
VALUEvalue.enumValues-
The attribute values associated with a resource in case attribute data type is
enum.
values-
The attribute values in case attribute data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
jsonValues-
The attribute values associated with a resource in case attribute data type is
JSON.
values- The attribute values in case attribute data type is string or JSON.
stringValues-
The attribute values associated with a resource in case attribute data type is
string.
values- The attribute values in case attribute data type is string or JSON.
uriValues-
The attribute values associated with a resource in case attribute data type is
URL, URI or IP, like gs://bucket-name/object-name.
values- The attribute values in case attribute data type is string or JSON.
Shorthand Example:--update-attributes=string={enumValues={values=[{description=string,displayName=string,id=string,immutable=boolean}]},jsonValues={values=[string]},stringValues={values=[string]},uriValues={values=[string]}}
JSON Example:--update-attributes='{"string": {"enumValues": {"values": [{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]}, "jsonValues": {"values": ["string"]}, "stringValues": {"values": ["string"]}, "uriValues": {"values": ["string"]}}}'
File Example:--update-attributes=path_to_file.(yaml|json)
-
At most one of these can be specified:
--clear-attributes- Clear attributes value and set to empty map.
--remove-attributes=REMOVE_ATTRIBUTES-
Remove existing value from map attributes. Sets
remove_attributesvalue.Shorthand Example:--remove-attributes=string,stringJSON Example:--remove-attributes=["string"]
File Example:--remove-attributes=path_to_file.(yaml|json)
- The spec contents.
--clear-contents- Set googleCloudApihubV1Spec.contents back to default value.
--contents=CONTENTS- The contents of the spec.
--contents-mime-type=CONTENTS_MIME_TYPE- The mime type of the content for example application/json, application/yaml, application/wsdl etc.
- Documentation details.
--clear-documentation- Set googleCloudApihubV1Spec.documentation back to default value.
--documentation-external-uri=DOCUMENTATION_EXTERNAL_URI- The uri of the externally hosted documentation.
- LintResponse contains the response from the linter.
--clear-lint-response- Set googleCloudApihubV1Spec.lintResponse back to default value.
--lint-response-create-time=LINT_RESPONSE_CREATE_TIME- Timestamp when the linting response was generated.
--lint-response-linter=LINT_RESPONSE_LINTER-
Name of the linter used.
LINT_RESPONSE_LINTERmust be one of:other- Linter type other.
spectral- Linter type spectral.
--lint-response-source=LINT_RESPONSE_SOURCE- Name of the linting application.
--lint-response-state=LINT_RESPONSE_STATE-
Lint state represents success or failure for linting.
LINT_RESPONSE_STATEmust be one of:lint-state-error- Linting encountered errors.
lint-state-success- Linting was completed successfully.
-
Update lint_response_issues.
At most one of these can be specified:
--lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY]-
Set lint_response_issues to new value. Array of issues found in the analyzed
document.
code- Rule code unique to each rule defined in linter.
message- Human-readable message describing the issue found by the linter.
path- An array of strings indicating the location in the analyzed document where the rule was triggered.
range-
Object describing where in the file the issue was found.
end-
End of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
start-
Start of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
severity- Severity level of the rule violation.
Shorthand Example:--lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string --lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string
JSON Example:--lint-response-issues='[{"code": "string", "message": "string", "path": ["string"], "range": {"end": {"character": int, "line": int}, "start": {"character": int, "line": int}}, "severity": "string"}]'
File Example:--lint-response-issues=path_to_file.(yaml|json)
-
Or at least one of these can be specified:
--add-lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY]-
Add new value to lint_response_issues list. Array of issues found in the
analyzed document.
code- Rule code unique to each rule defined in linter.
message- Human-readable message describing the issue found by the linter.
path- An array of strings indicating the location in the analyzed document where the rule was triggered.
range-
Object describing where in the file the issue was found.
end-
End of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
start-
Start of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
severity- Severity level of the rule violation.
Shorthand Example:--add-lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string --add-lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string
JSON Example:--add-lint-response-issues='[{"code": "string", "message": "string", "path": ["string"], "range": {"end": {"character": int, "line": int}, "start": {"character": int, "line": int}}, "severity": "string"}]'
File Example:--add-lint-response-issues=path_to_file.(yaml|json)
-
At most one of these can be specified:
--clear-lint-response-issues- Clear lint_response_issues value and set to empty list.
--remove-lint-response-issues=[code=CODE],[message=MESSAGE],[path=PATH],[range=RANGE],[severity=SEVERITY]-
Remove existing value from lint_response_issues list. Array of issues found in
the analyzed document.
code- Rule code unique to each rule defined in linter.
message- Human-readable message describing the issue found by the linter.
path- An array of strings indicating the location in the analyzed document where the rule was triggered.
range-
Object describing where in the file the issue was found.
end-
End of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
start-
Start of the issue.
character- Character position within the line (zero-indexed).
line- Line number (zero-indexed).
severity- Severity level of the rule violation.
Shorthand Example:--remove-lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string --remove-lint-response-issues=code=string,message=string,path=[string],range={end={character=int,line=int},start={character=int,line=int}},severity=string
JSON Example:--remove-lint-response-issues='[{"code": "string", "message": "string", "path": ["string"], "range": {"end": {"character": int, "line": int}, "start": {"character": int, "line": int}}, "severity": "string"}]'
File Example:--remove-lint-response-issues=path_to_file.(yaml|json)
-
Update lint_response_summary.
At most one of these can be specified:
--lint-response-summary=[count=COUNT],[severity=SEVERITY]-
Set lint_response_summary to new value. Summary of all issue types and counts
for each severity level.
count- Count of issues with the given severity.
severity- Severity of the issue.
Shorthand Example:--lint-response-summary=count=int,severity=string --lint-response-summary=count=int,severity=string
JSON Example:--lint-response-summary='[{"count": int, "severity": "string"}]'
File Example:--lint-response-summary=path_to_file.(yaml|json)
-
Or at least one of these can be specified:
--add-lint-response-summary=[count=COUNT],[severity=SEVERITY]-
Add new value to lint_response_summary list. Summary of all issue types and
counts for each severity level.
count- Count of issues with the given severity.
severity- Severity of the issue.
Shorthand Example:--add-lint-response-summary=count=int,severity=string --add-lint-response-summary=count=int,severity=string
JSON Example:--add-lint-response-summary='[{"count": int, "severity": "string"}]'
File Example:--add-lint-response-summary=path_to_file.(yaml|json)
-
At most one of these can be specified:
--clear-lint-response-summary- Clear lint_response_summary value and set to empty list.
--remove-lint-response-summary=[count=COUNT],[severity=SEVERITY]-
Remove existing value from lint_response_summary list. Summary of all issue
types and counts for each severity level.
count- Count of issues with the given severity.
severity- Severity of the issue.
Shorthand Example:--remove-lint-response-summary=count=int,severity=string --remove-lint-response-summary=count=int,severity=string
JSON Example:--remove-lint-response-summary='[{"count": int, "severity": "string"}]'
File Example:--remove-lint-response-summary=path_to_file.(yaml|json)
- The attribute values associated with resource.
--clear-spec-type- Set googleCloudApihubV1Spec.specType back to default value.
-
Arguments for the Value.
At most one of these can be specified:
- The attribute values of data type string or JSON.
--spec-type-json-values=[SPEC_TYPE_JSON_VALUES,…]- The attribute values in case attribute data type is string or JSON.
- The attribute values of data type string or JSON.
--spec-type-string-values=[SPEC_TYPE_STRING_VALUES,…]- The attribute values in case attribute data type is string or JSON.
- The attribute values of data type string or JSON.
--spec-type-uri-values=[SPEC_TYPE_URI_VALUES,…]- The attribute values in case attribute data type is string or JSON.
- The attribute values of data type enum.
-
Update spec_type_enum_values.
At most one of these can be specified:
--spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]-
Set spec_type_enum_values to new value. The attribute values in case attribute
data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
Shorthand Example:--spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean --spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:--spec-type-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:--spec-type-enum-values=path_to_file.(yaml|json)
-
Or at least one of these can be specified:
--add-spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]-
Add new value to spec_type_enum_values list. The attribute values in case
attribute data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
Shorthand Example:--add-spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean --add-spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:--add-spec-type-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:--add-spec-type-enum-values=path_to_file.(yaml|json)
-
At most one of these can be specified:
--clear-spec-type-enum-values- Clear spec_type_enum_values value and set to empty list.
--remove-spec-type-enum-values=[description=DESCRIPTION],[displayName=DISPLAYNAME],[id=ID],[immutable=IMMUTABLE]-
Remove existing value from spec_type_enum_values list. The attribute values in
case attribute data type is enum.
description- The detailed description of the allowed value.
displayName- The display name of the allowed value.
id-
The ID of the allowed value.
- If provided, the same will be used. The service will throw an error if the specified id is already used by another allowed value in the same attribute resource.
- If not provided, a system generated id derived from the display name will be used. In this case, the service will handle conflict resolution by adding a system generated suffix in case of duplicates.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
immutable- When set to true, the allowed value cannot be updated or deleted by the user. It can only be true for System defined attributes.
Shorthand Example:--remove-spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean --remove-spec-type-enum-values=description=string,displayName=string,id=string,immutable=boolean
JSON Example:--remove-spec-type-enum-values='[{"description": "string", "displayName": "string", "id": "string", "immutable": boolean}]'
File Example:--remove-spec-type-enum-values=path_to_file.(yaml|json)
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - API REFERENCE
-
This command uses the
apihub/v1API. The full documentation for this API can be found at: https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub - NOTES
-
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation-only early access
allowlist. This variant is also available:
gcloud apihub apis versions specs update
gcloud alpha apihub apis versions specs update
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-24 UTC.