gcloud alpha api-gateway api-configs create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha api-gateway api-configs create - add a new config to an API
- SYNOPSIS
gcloud alpha api-gateway api-configs create(API_CONFIG:--api=API)(--grpc-files=[FILE,…] |--openapi-spec=[FILE,…])[--async][--backend-auth-service-account=BACKEND_AUTH_SERVICE_ACCOUNT][--display-name=DISPLAY_NAME][--labels=[KEY=VALUE,…]][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Add a new config to an API.NOTE: If the specified API does not exist it will be created.
- EXAMPLES
- To create an API config for the API 'my-api' with an OpenAPI spec, run:
gcloudalphaapi-gatewayapi-configscreatemy-config--api=my-api--openapi-spec=path/to/openapi_spec.yaml - POSITIONAL ARGUMENTS
- Api config resource - Name for API Config which will be created. The argumentsin 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 otherways.
To set the
projectattribute:- provide the argument
api_configon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
To set the
locationattribute:- provide the argument
api_configon the command line with a fullyspecified name; - Location for API and API Configs. Defaults to global.
This must be specified.
API_CONFIG- ID of the api-config or fully qualified identifier for the api-config.
To set the
api-configattribute:- provide the argument
api_configon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--api=API- API ID.
To set the
apiattribute:- provide the argument
api_configon the command line with a fullyspecified name; - provide the argument
--apion the command line.
- provide the argument
- provide the argument
- Api config resource - Name for API Config which will be created. The argumentsin 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 otherways.
- REQUIRED FLAGS
- Configuration files for the API.
Exactly one of these must be specified:
--grpc-files=[FILE,…]- Files describing the GRPC service. Google Service Configuration files in JSON orYAML formats as well as Proto descriptors should be listed.
--openapi-spec=[FILE,…]- The OpenAPI specifications containing service configuration information, and APIspecification for the gateway.
- Configuration files for the API.
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--backend-auth-service-account=BACKEND_AUTH_SERVICE_ACCOUNT- Service account which will be used to sign tokens for backends withauthentication configured.
--display-name=DISPLAY_NAME- Human readable name which can optionally be supplied.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers.
- 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. - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudapi-gatewayapi-configscreategcloudbetaapi-gatewayapi-configscreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-24 UTC.