APIs and subscriptions
Weik.io 2026.2Serve API versions on your gateways and give callers access through subscriptions. Video
Watch: Publish an API and call it, 3:55
The video publishes an API in front of an integration and deploys it to production. Then it calls the API with curl.
This part of the video couldn't be loaded.
On this page
- Commands on this page
- weikio gateway create
- weikio gateway set
- weikio gateway diff
- weikio get gateways
- weikio describe gateway
- weikio get apim-instances
- weikio delete gateway
- weikio rename gateway
- weikio api deploy
- weikio api promote
- weikio api rollback
- weikio api undeploy
- weikio api set-gateways
- weikio api set-rules
- weikio get api-deployments
- weikio get apis
- weikio describe api
- weikio get apiversions
- weikio describe apiversion
- weikio delete api
- weikio rename api
- weikio delete apiversion
- weikio get subscriptions
- weikio subscription create
- weikio subscription set
- weikio subscription key
- weikio subscription rotate-key
- weikio subscription disable
- weikio subscription enable
- weikio delete subscription
- Exit codes
- See also
After you publish an API, you serve its versions on gateways and choose who may call them.
Each gateway accepts calls to one environment on its hostnames. Its rules set who may call it and how often. Weik.io obtains and renews a certificate for each hostname unless you upload one.
To let a caller use APIs on a gateway, you give it a subscription on that gateway. Unless the subscription admits callers with no credential, its type sets how the caller proves who it is:
- An API key
- A query parameter
- Basic credentials
- An OpenID Connect token
- A client certificate
Commands on this page#
| Command | What it does |
|---|---|
weikio gateway create |
Create a gateway in an environment. |
weikio gateway set |
Change a gateway, keeping the fields you don’t set. |
weikio gateway diff |
Compare the rules of two gateways. |
weikio get gateways |
List the gateways. |
weikio describe gateway |
Show a gateway in full, including its certificates and what uses it. |
weikio get apim- |
List the APIM instances with their entrances and the gateway revisions they serve. |
weikio delete gateway |
Delete a gateway. |
weikio rename gateway |
Rename a gateway. |
weikio api deploy |
Deploy an API version to an environment’s gateways. |
weikio api promote |
Deploy what one environment serves to another, keeping the destination’s gateways and overrides. |
weikio api rollback |
Roll a deployment back to the definition it served before. |
weikio api undeploy |
Undeploy an API version from an environment. |
weikio api set- |
Change the gateways of a deployment, keeping its definition. |
weikio api set- |
Make a gateway’s rules stricter for one deployment. |
weikio get api- |
List a project’s API deployments, in every environment unless --env is given. |
weikio get apis |
List the APIs of a project. |
weikio describe api |
Show an API in full, including its subscriptions and its calls of the last day. |
weikio get apiversions |
List the versions of one API. |
weikio describe apiversion |
Show an API version with its routes and clusters. |
weikio delete api |
Delete an API and its versions. |
weikio rename api |
Rename an API. |
weikio delete apiversion |
Delete one version of an API. |
weikio get subscriptions |
List a project’s subscriptions with their calls of the last day. |
weikio subscription create |
Create a subscription in one environment. |
weikio subscription set |
Change the given fields of a subscription. |
weikio subscription key |
Create a subscription’s first credential and print it once. |
weikio subscription rotate-key |
Replace the credential of a subscription and print the new one once. |
weikio subscription disable |
Disable a subscription. |
weikio subscription enable |
Enable a subscription. |
weikio delete subscription |
Delete a subscription. |
The tables below leave out the flags every command accepts, such as --env, --project, -o and --context, which the CLI reference lists.
weikio gateway create#
Create a gateway in an environment. --networks is required.
weikio gateway create <name> [--env E] --networks internet|CIDR,... [--hostname H ...] [--display-name S] [--served-by hub|site] [--entrance N ...] [--projects p,...] [--default] [--like G] [--relay-from G,...] [--client-certificate none|optional|required] [--authority A=CA.pem[,CA.pem] ...] [--caller-limit N/W] [--subscription-limit N/W] [--upstream-networks CIDR,...] [--max-request-size SIZE] [--server-certificate NAME=CHAIN.pem,KEY.pem ...] [--certificate-source automatic|public|platform|uploaded|AUTHORITY] [-y]| Argument or flag | What it does |
|---|---|
<name> |
Sets the new gateway’s name. |
--like <like> |
Copies networks, entrances, client certificate rules, limits, upstreams and request size from this gateway. |
-- |
Sets the gateway’s display name. Give “” to remove it. |
-- |
Adds a hostname that callers use to reach the gateway. Repeat it for each hostname. |
-- |
Sets the networks that may call the gateway, as internet for any caller or as address ranges such as 10.0.0.0/8, comma separated. |
-- |
Sets who serves the gateway, as hub, or as site for the agents with the capability gateway=<name>. |
-- |
Adds an entrance where the gateway accepts calls. Repeat it for each entrance. The default is the hub’s entrance, when the hub has one. |
-- |
Sets the projects that may use the gateway, comma separated. Give “” for any project. |
-- |
Makes it a default gateway. Deployments and subscriptions of its projects that set no gateway use it. |
-- |
Sets the hub gateways of the same environment that may relay calls into this site gateway, comma separated. |
-- |
Uploads a certificate for the gateway’s hostnames, as NAME=CHAIN.pem,KEY.pem. Repeat it for each certificate. |
-- |
Sets who signs the certificates of the gateway’s hostnames, as automatic, public (the installation’s public authority), platform, uploaded or a certificate authority’s name. |
-- |
Sets whether callers need a client certificate, as none, optional or required. |
-- |
Sets an authority whose client certificates the gateway accepts, as NAME=CA.pem[,CA.pem]. Repeat it for each authority. The CA certificates you give replace that authority’s current ones. |
-- |
Sets the calls allowed per caller address, as N/W, such as 600/1m. Each APIM instance counts calls separately. |
-- |
Sets the calls allowed per subscription that has no limit of its own, as N/W, such as 600/1m. All APIM instances count these calls together. |
-- |
Sets the address ranges the gateway’s APIs may call, comma separated. Give “” for anywhere. |
-- |
Sets the largest request body the gateway accepts, such as 10MB. Give “” for the platform’s limit. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a platform administrator.
API:
PUT /api/v1/gateways/{name}GET /api/v1/settings/installGET /api/v1/gateways/{like}
Also written as weikio create gateway.
$ weikio gateway create internal --env production --hostname api.example.com --networks 10.0.0.0/8 --default -yTarget: https://hub.example, environment production (--env)
gateway internal created (environment production, revision 12)
Listens on the hub's entrance 'public' to callers in 10.0.0.0/8.
api.example.com points at this hub. Requesting its certificate from Let's Encrypt. HTTPS is served once it's issued (weikio describe gateway internal).weikio gateway set#
Change a gateway, keeping the fields you don’t set. When you add a hostname, Weik.io obtains its certificate unless you upload one.
weikio gateway set <name> [the flags of create] [--no-default] [--remove-hostname H ...] [--remove-server-certificate NAME ...] [--projects ""] [--remove-authority A ...] [--revoke-certificate A=leaf.pem|SHA256 ...] [--unrevoke-certificate A=leaf.pem|SHA256 ...] [--no-caller-limit] [--no-subscription-limit] [--upstream-networks ""] [--max-request-size ""] [-y]| Argument or flag | What it does |
|---|---|
<name> |
Identifies the gateway. |
-- |
Makes it no longer a default gateway. |
-- |
Removes a hostname. Repeat the flag for each hostname you remove. |
-- |
Removes an uploaded certificate by its name. Repeat it for each certificate. |
-- |
Sets the gateway’s display name. Give “” to remove it. |
-- |
Adds a hostname that callers use to reach the gateway. Repeat it for each hostname. |
-- |
Sets the networks that may call the gateway, as internet for any caller or as address ranges such as 10.0.0.0/8, comma separated. |
-- |
Sets who serves the gateway, as hub, or as site for the agents with the capability gateway=<name>. |
-- |
Adds an entrance where the gateway accepts calls. Repeat it for each entrance. The default is the hub’s entrance, when the hub has one. |
-- |
Sets the projects that may use the gateway, comma separated. Give “” for any project. |
-- |
Makes it a default gateway. Deployments and subscriptions of its projects that set no gateway use it. |
-- |
Sets the hub gateways of the same environment that may relay calls into this site gateway, comma separated. |
-- |
Uploads a certificate for the gateway’s hostnames, as NAME=CHAIN.pem,KEY.pem. Repeat it for each certificate. |
-- |
Sets who signs the certificates of the gateway’s hostnames, as automatic, public (the installation’s public authority), platform, uploaded or a certificate authority’s name. |
-- |
Sets whether callers need a client certificate, as none, optional or required. |
-- |
Sets an authority whose client certificates the gateway accepts, as NAME=CA.pem[,CA.pem]. Repeat it for each authority. The CA certificates you give replace that authority’s current ones. |
-- |
Sets the calls allowed per caller address, as N/W, such as 600/1m. Each APIM instance counts calls separately. |
-- |
Sets the calls allowed per subscription that has no limit of its own, as N/W, such as 600/1m. All APIM instances count these calls together. |
-- |
Sets the address ranges the gateway’s APIs may call, comma separated. Give “” for anywhere. |
-- |
Sets the largest request body the gateway accepts, such as 10MB. Give “” for the platform’s limit. |
-- |
Stops accepting the client certificates of this authority. Repeat it for each authority. |
-- |
Revokes a client certificate, as AUTHORITY=leaf.pem or AUTHORITY=SHA256 fingerprint. Repeat it for each certificate. |
-- |
Accepts a revoked client certificate again, as AUTHORITY=leaf.pem or AUTHORITY=SHA256 fingerprint. Repeat it for each certificate. |
-- |
Removes the caller limit. |
-- |
Removes the limit for subscriptions that set none of their own. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a platform administrator.
API: PUT /api/v1/gateways/{name}, GET /api/v1/apim/instances.
weikio gateway diff#
Compare the rules of two gateways.
weikio gateway diff <gateway> <other>| Argument or flag | What it does |
|---|---|
<gateway> |
Identifies one gateway. |
<other> |
Identifies the gateway to compare it with. |
Who can run it: a grant whose role has read in the environment.
API: GET /api/v1/gateways/{a}/diff/{b}.
weikio get gateways#
List the gateways.
weikio get gateways [--env E]Who can run it: a grant whose role has read in the environment.
API: GET /api/v1/gateways?environment=.
Also written as weikio get gateway.
weikio describe gateway#
Show a gateway in full, including its certificates and what uses it.
weikio describe gateway <name>| Argument or flag | What it does |
|---|---|
<name> |
Identifies the gateway. |
Who can run it: a grant whose role has read in the environment.
API: GET /api/v1/gateways/{name}, GET /api/v1/apim/instances.
Also written as weikio describe gateways.
weikio get apim-instances#
List the APIM instances with their entrances and the gateway revisions they serve.
weikio get apim-instancesWho can run it: a platform administrator. A reader of an environment sees the APIM instances that serve its gateways.
API: GET /api/v1/apim/instances.
Also written as weikio get apim-instance.
weikio delete gateway#
Delete a gateway.
weikio delete gateway <name> [-y]| Argument or flag | What it does |
|---|---|
<name> |
Identifies the gateway. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a platform administrator.
API: DELETE /api/v1/gateways/{name}.
Also written as weikio delete gateways.
weikio rename gateway#
Rename a gateway.
weikio rename gateway <name> <new-name>| Argument or flag | What it does |
|---|---|
<name> |
Identifies the gateway. |
<new- |
Sets the new name. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a platform administrator.
API: PATCH /api/v1/gateways/{name}.
weikio api deploy#
Deploy an API version to an environment’s gateways. Without --gateways, a new deployment is served on the environment’s only gateway, or on its default gateways that allow the project. A deployment that already exists keeps its gateways.
weikio api deploy <p>/<api>@<v> [--env E] [--gateways G,...] [--set k=v ...] [--unset k ...] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-- |
Sets the gateways that serve the version, comma separated. |
--set <set> |
Adds an override, as k=v, to the deployment’s other overrides. Repeat it for each override. |
-- |
Removes the override with this name. Repeat the flag for each override you remove. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the destination environment.
API: PUT /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}, GET /api/v1/gateways?environment=.
$ weikio apply -f ./finance/apis/Target: https://hub.example, project finance (from finance/project.yaml)
api finance/invoices created
api-version finance/invoices@v1 created (type proxy, rate limit 1200/1m)
api-version finance/bank-notifications@v1 created (type webhook, channel bank-notification-received)
api-deployment devtest/finance/invoices@v1 created
api-subscription devtest/finance/partner-y created
Gateways updated in: devtest.weikio api promote#
Deploy what one environment serves to another. The destination gets the definition the source serves. It keeps its own overrides and its gateways with the rules set on each.
weikio api promote <p>/<api>@<v> --from E1 [--to E2] [--gateways G,...] [--dry-run] [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
--from <from> |
Sets the environment to copy from. |
--to <to> |
Sets the environment to copy into. |
-- |
Sets the gateways that serve the version, comma separated. |
-- |
Prints what would happen and changes nothing. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the destination environment.
API: GET /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v} in both environments, PUT /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v} in the destination, GET /api/v1/gateways?environment=.
$ weikio api promote finance/invoices@v1 --from devtest --to production -yTarget: https://hub.example, project finance (argument), environment production (--to)
api-deployment production/finance/invoices@v1 created (gateways internal, definition 3f9a0c1e2b4d, revision 31)
Served at https://api.example.com/invoices/v1 (gateway internal).weikio api rollback#
Roll a deployment back to the definition it served before.
weikio api rollback <p>/<api>@<v> [--env E] [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the environment.
API: POST /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}/rollback.
weikio api undeploy#
Undeploy an API version from an environment.
weikio api undeploy <p>/<api>@<v> [--env E] [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the environment.
API: DELETE /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}.
weikio api set-gateways#
Change a deployment’s gateways and leave its definition as it is.
weikio api set-gateways <p>/<api>@<v> [--env E] [--add G,...] [--remove G,...] [--via HUB=SITE ...] [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
--add <add> |
Adds gateways, comma separated. |
-- |
Removes gateways, comma separated. |
--via <via> |
Sets a hub gateway that relays calls to a site gateway, as HUB=SITE. Repeat it as needed. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the environment.
API:
GET /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}PUT /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}GET /api/v1/gateways?environment=
weikio api set-rules#
Make a gateway’s rules stricter for one deployment.
weikio api set-rules <p>/<api>@<v> [--env E] --gateway G [--networks CIDR,...] [--client-certificate optional|required] [--authority A ...] [--caller-limit N/W] [--subscription-limit N/W] | --clear [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-- |
Identifies the gateway whose rules you make stricter. |
-- |
Sets the address ranges within the gateway’s networks that may call this API, comma separated. |
-- |
Sets whether callers need a client certificate, as optional or required. |
-- |
Sets a gateway authority whose client certificates this API accepts. Repeat it as needed. |
-- |
Sets the calls allowed per caller address, as N/W, such as 600/1m. |
-- |
Sets the calls allowed per subscription that has no limit of its own, as N/W, such as 600/1m. |
-- |
Removes this API’s stricter rules on the gateway. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has deploy in the environment.
API:
GET /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}PUT /api/v1/environments/{environment}/projects/{project}/api-deployments/{api}/{v}GET /api/v1/gateways?environment=
weikio get api-deployments#
List a project’s API deployments, in every environment unless --env is given.
weikio get api-deployments [--env E] [--project P] [--api A]| Argument or flag | What it does |
|---|---|
--api <api> |
Shows only the deployments of this API. |
Who can run it: a grant whose role has read in the environment.
API: GET /api/v1/environments/{environment}/projects/{project}/api-deployments, GET /api/v1/projects/{project}/apis/{api}/deployments.
Also written as weikio get api-deployment.
$ weikio get api-deployments --api invoicesENVIRONMENT API DEFINITION GATEWAYS DEPLOYED BY DEPLOYED STATE
devtest finance/invoices@v1 3f9a0c1e2b4d devtest anna@example.com 2026-10-08 09:14 UTC -
production finance/invoices@v1 3f9a0c1e2b4d internal anna@example.com 2026-10-08 09:20 UTC -weikio get apis#
List the APIs of a project.
weikio get apis [--project P]Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/apis, GET /api/v1/environments/{environment}/projects/{project}/api-deployments.
weikio describe api#
Show an API in full, including its subscriptions and its calls of the last day.
weikio describe api <p>/<n>| Argument or flag | What it does |
|---|---|
<api> |
Identifies the API, as project/name. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/apis/{name}, GET /api/v1/environments/{environment}/projects/{project}/api-subscriptions?api=, GET /api/v1/metrics/summary, GET /api/v1/traces/_related.
weikio get apiversions#
List the versions of one API.
weikio get apiversions <p>/<api>| Argument or flag | What it does |
|---|---|
<api> |
Identifies the API, as project/name. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/apis/{api}/versions, GET /api/v1/projects/{project}/apis/{api}/deployments.
weikio describe apiversion#
Show an API version with its routes and clusters.
weikio describe apiversion <p>/<api>@<version> [--openapi]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-- |
Prints the version’s OpenAPI document instead. |
Who can run it: a grant on the project whose role has read.
API: GET /api/v1/projects/{project}/apis/{api}/versions/{version}.
weikio delete api#
Delete an API and its versions.
weikio delete api <p>/<n> [-y]| Argument or flag | What it does |
|---|---|
<api> |
Identifies the API, as project/name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: DELETE /api/v1/projects/{project}/apis/{name}.
weikio rename api#
Rename an API.
weikio rename api <p>/<n> <new-name>| Argument or flag | What it does |
|---|---|
<name> |
Identifies the API, as project/name. |
<new- |
Sets the new name in the same project. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: PATCH /api/v1/projects/{project}/apis/{name}.
weikio delete apiversion#
Delete one version of an API.
weikio delete apiversion <p>/<api>@<version> [-y]| Argument or flag | What it does |
|---|---|
<apiversion> |
Identifies the API version, as project/api@version. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: DELETE /api/v1/projects/{project}/apis/{api}/versions/{version}.
weikio get subscriptions#
List a project’s subscriptions with their calls of the last day.
weikio get subscriptions [--env E] [--project P] [--api A]| Argument or flag | What it does |
|---|---|
--api <api> |
Shows only the subscriptions to this API. |
Who can run it: a grant whose role has read in the environment.
API: GET /api/v1/environments/{environment}/projects/{project}/api-subscriptions?api=, GET /api/v1/projects/{project}/api-subscriptions?api=.
$ weikio get subscriptions --env productionNAME PROJECT APIS GATEWAY TYPE ACTIVE RATE LIMIT EXPIRES CALLS 24H LIMITED LAST CALL
partner-x finance invoices internal apikey yes 60/1m - 0 0 -weikio subscription create#
Create a subscription in one environment. For the types apikey, queryparameter and basic, the command prints the credential once as its last line. Weik.io stores only a hash of the credential.
weikio subscription create <p>/<name> [--env E] [--gateway G] --api A[,B ...] --type apikey|queryparameter|basic|oidc|anonymous|certificate [--owner S] [--rate-limit N/W] [--expires T] [--header "k: v" ...] [--username S] [--oidc-issuer URL --oidc-audience S] [--certificate-authority A --certificate-name N]| Argument or flag | What it does |
|---|---|
<subscription> |
Sets the subscription’s name, as project/name. |
-- |
Sets the subscription’s gateway. The default is the environment’s only gateway, or its only default gateway that allows the project. |
--api <api> |
Sets the subscription’s APIs, comma separated. |
--type <type> |
Sets how callers authenticate, as apikey, queryparameter, basic, oidc, anonymous or certificate. |
-- |
Sets who the subscription is for. Without it, the owner is the subscription’s name. |
-- |
Sets the subscription’s rate limit, as N/W, such as 600/1m. |
-- |
Sets when the subscription expires, as a duration such as 90d or a date such as 2027-01-01. |
-H, -- |
Sets a header the gateway adds to this subscription’s requests, as “Name: value”. Repeat it for each header. |
-- |
Sets the username of a basic credential. The default is the subscription’s current username, or its name. |
-- |
Sets the issuer of the caller’s tokens, for type oidc. |
-- |
Sets the audience the caller’s tokens must have, for type oidc. |
-- |
Sets the gateway authority that issues the caller’s client certificate, for type certificate. |
-- |
Sets the name in the caller’s client certificate, for type certificate. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: PUT /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}.
Also written as weikio create subscription.
$ weikio subscription create finance/partner-x --env production --api invoices --type apikey --rate-limit 60/1m -yTarget: https://hub.example, project finance (argument), environment production (--env)
api-subscription production/finance/partner-x created (gateway internal, type apikey, APIs invoices, rate limit 60/1m)
To rotate the key later:
weikio subscription rotate-key finance/partner-x --env production
API key (shown once): ****************************************$ curl -H "X-Api-Key: $PARTNER_KEY" https://api.example.com/invoices/v1/pendingweikio subscription set#
Change the given fields of a subscription.
weikio subscription set <p>/<name> --env E [--api a,b] [--owner S] [--rate-limit N/W] [--expires 90d|date] [--header "Name: value" ...] [--oidc-issuer URL] [--oidc-audience S] [--certificate-authority A] [--certificate-name N]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
--api <api> |
Sets the subscription’s APIs, comma separated, in place of the current ones. |
-- |
Sets who the subscription is for. |
-- |
Sets the subscription’s rate limit, as N/W, such as 600/1m. |
-- |
Sets when the subscription expires, as a duration such as 90d or a date such as 2027-01-01. |
-H, -- |
Sets a header the gateway adds to this subscription’s requests, as “Name: value”. Repeat it for each header. The headers you give replace the current ones. |
-- |
Sets the issuer of the caller’s tokens, for type oidc. |
-- |
Sets the audience the caller’s tokens must have, for type oidc. |
-- |
Sets the gateway authority that issues the caller’s client certificate, for type certificate. |
-- |
Sets the name in the caller’s client certificate, for type certificate. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: PUT /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}.
weikio subscription key#
Create a subscription’s first credential and print it once. Use it for a subscription that came from Git through weikio apply, whose document has no credential.
weikio subscription key <p>/<name> [--env E] [--username S]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
-- |
Sets the username of a basic credential. The default is the subscription’s current username, or its name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: POST /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}/credential.
weikio subscription rotate-key#
Replace the credential of a subscription and print the new one once.
weikio subscription rotate-key <p>/<name> [--env E] [--username S] [-y]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
-- |
Sets the username of a basic credential. The default is the subscription’s current username, or its name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: POST /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}/credential.
weikio subscription disable#
Disable a subscription.
weikio subscription disable <p>/<name> [--env E]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: PATCH /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}.
weikio subscription enable#
Enable a subscription.
weikio subscription enable <p>/<name> [--env E]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: PATCH /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}.
weikio delete subscription#
Delete a subscription.
weikio delete subscription <p>/<name> [--env E] [-y]| Argument or flag | What it does |
|---|---|
<subscription> |
Identifies the subscription, as project/name. |
-y, --yes |
Skips the confirmation. |
-- |
Stores a reason for the change with the audit record. |
Who can run it: a grant on the project whose role has author.
API: DELETE /api/v1/environments/{environment}/projects/{project}/api-subscriptions/{name}.
Exit codes#
The codes match the exit code table in the CLI reference.
| Code | Meaning |
|---|---|
| 0 | The command succeeded. |
| 1 | The command stopped without making the change. |
| 2 | The command has a usage error. |
| 3 | Your key is missing, expired or revoked, or its access doesn’t cover the command. |
| 4 | What you named doesn’t exist. |
| 5 | The change conflicts with another change. |
| 6 | Weik.io couldn’t be reached or wasn’t ready, or it was rate limiting your calls or out of storage. Run the command again later. |
| 8 | A document isn’t valid. |