API Stability |
Long-Term
|
The createActionFromTemplate() GraphQL
mutation is used to create an action from a
yaml
template.
For more information on creating an action, see the Actions documentation page.
Syntax
Below is the syntax for the createActionFromTemplate() mutation field:
createActionFromTemplate(
input: CreateActionFromTemplateInput!
): Action!
For the given datatype, you'll have to provide the yamlTemplate parameter with a YAML template within quotes. That can be complicated. You might try copying one from a package template for a starting point, and then edit it to your needs. See createActionFromPackageTemplate() .
Below is an example of how this mutation field might be used:
mutation {
createActionFromTemplate(input:
{viewName: "humio",
name: "test-action",
yamlTemplate: "name: Actor\nmethod: POST ... " } )
{ id, name, isAllowedToRun }
}
{
"data": {
"createActionFromTemplate": {
"id": "2zLdPUtUOtvi7htJTqNavETrnkODcz86",
"name": "test-action",
"isAllowedToRun": true
}
}
}
Given Datatypes
For
CreateActionFromTemplateInput
,
there are a few parameters. Below is a list of them:
Table: CreateActionFromTemplateInput
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Sep 17, 2024 | |||||
name | string | yes | Long-Term | The name of the action. | |
viewName | string | yes | Long-Term | The name of the view of the action. | |
yamlTemplate | yaml | yes | Long-Term | A template that can be used to recreate the action. |
Returned Datatypes
The returned interface action
has its own
parameters. Below is a list of them along with their datatypes and
a description of each:
Table: Action
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Mar 17, 2025 | |||||
allowedActions | [AssetAction ] | yes | Preview | A list of allowed asset actions. See AssetAction . | |
displayName | string | yes | Long-Term | The display name of the action. | |
id | string | yes | Long-Term | The unique identifier of the action. | |
isAllowedToRun | boolean | yes | Long-Term | Whether the action is allowed to run. Should be false if this type of action is disabled because of a security policy. | |
name | string | yes | Long-Term | The name of the action. | |
package | PackageInstallation | Long-Term | The package, if any, of which the action is part. See PackageInstallation . | ||
packageId | VersionedPackageSpecifier | Long-Term | The unique identifier of the package. See VersionedPackageSpecifier . | ||
requiresOrganizationOwnedQueriesPermissionToEdit | boolean | yes | Long-Term | This should be set to true if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action. | |
resource | string | yes | Short-Term | The resource identifier for the action. | |
yamlTemplate | yaml | yes | Long-Term | A template that can be used to recreate the action. |