apiPolicyTemplateApply
Applies one or more policy templates to multiple API deployments. Input Parameters:
input: Configuration object containing templates (each identified by ID and optional version) and deployments. Ifversionis omitted for a template, the latest version is applied. Each entry'stemplateslist is applied in the order given, and re-applying a permuted list updates the order of existing template links accordingly. The sametemplatePathmay appear in more than one entry, including for the same deployed API; entries are processed in order, so templates from a later entry are ordered after templates from an earlier entry at the same path (subject toTEMPLATE_ALREADY_APPLIED_AT_PATHwhen entries conflict on the same template family). Response:- Returns an array of updated DeployedApi objects with applied template configurations.
- If
templatesis provided, the specified templates are added to the deployments at the given path (additive — existing templates at that path are not removed, though their order may be updated). To remove all templates at a path, pass an emptytemplates— this deletes all template associations for the specified deployed APIs at that path. Example Request:
mutation {
apiPolicyTemplateApply(
input: [
{
templates: [{ id: "<xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx>", version: 1 }],
deployedApiIds: ["<aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa>"],
templatePath: "/stream"
},
{
templates: [],
deployedApiIds: ["<aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa>"],
templatePath: "/text"
}
]
) {
id,
version,
component {
id,
name
},
policyTemplatesApplied {
templatePath,
templates {
id,
name,
rules {
rules { id, name },
appliedWhen
}
}
}
}
}
apiPolicyTemplateApply(
input: [DeployedApiPolicyTemplateApplyInput!]!
): [DeployedApi!]
Arguments
apiPolicyTemplateApply.input ● [DeployedApiPolicyTemplateApplyInput!]! non-null input platform {#input}
Type
DeployedApi object platform
Represents an API deployed to a specific environment and the various information associated with it (Component, ApiComponentMetadata, Environment, DeployedApiEndpoint, Keyless Plan, number of plans associated with Deployed Api, Execution Settings and required roles)
Was this topic helpful?