Overview
Create a namespace to hold resources, and a tag to label them, by using mutations and variables. The API key that runs the script needs the globalnamespaces:WRITE permission. It becomes an Admin of the namespace it creates, so the same script can go on to create credentials and sources in it.
Both mutations return an errors list. Check it before using the result, because a failed create returns errors instead of raising an exception.
Steps
1
Create a namespace
NamespaceCreateInput requires both an id and a name. The id is the namespace identifier that other resources refer to, such as the namespaceId of a credential, and it can’t be changed later. Use lowercase letters, numbers, hyphens, and underscores, which is the format the Validio UI generates from the namespace name. To give other users, teams, or API keys access, add members, teams, or apiKeys to the input, each with an ID and the role ID to assign. List namespace roles and their IDs with the roleConfigs query, filtered to type: Namespace. If you list the API key that runs the script, it gets that role instead of Admin. For more information, see Managing Namespaces.2
Create a tag
TagCreateInput uses key and value. For a key and value tag, set both, as in this example. For a label tag, set key to label and value to the label text. To apply the tag, pass its ID in tagIds when you create or update a resource, such as a source. For more information, see Managing Tags.Full code sample
Python