Working with Orchestrator tags

Let's explore the tagging of workflows. Tagging introduces the same kind of tagging you're familiar with from vCenter server. Tagging allows you to add tags to Orchestrator objects and search for them.

Getting ready

We need some elements such as a workflow or action we can tag.

How to do it...

Tagging involves the following procedures.

Tagging an element (manual)

Let's start by tagging a workflow manually.

  1. Open a workflow for editing.
  2. Go to the General tab and click on the [Type here to add a tag...].
  3. Type a tag name such as glbTest and then press Enter.
  4. Next, we are adding a tag with a value. Enter another tag such as author, then press Ctrl + S and then enter the value for the tag, such as Daniel.
  5. Click on Save and close.

    Tagging an element (manual)

Tagging a workflow (workflow)

You can tag a workflow using a workflow.

  1. Start the workflow by navigating to Library | Tagging | Tag workflow.
  2. Select the workflow you would like to tag.
  3. Enter a tag and a value.
  4. Select whether you would like this tag to be global or not. A Global tag is visible to all users, whereas non-global (private) tags are only visible to the user who places the tag:

    Tagging a workflow (workflow)

  5. Submit the workflow.

Viewing all tags in a workflow

  1. Start the workflow by navigating to Library | Tagging | List Workflow tags.
  2. Select the workflow for which you would like to see a list of all its tags.
  3. After submitting the workflow, check the logs. All tags and their values will be listed:

    Viewing all tags in a workflow

Finding workflows by tag

  1. Start the workflow by navigating to Library | Tagging | Find objects by tag.
  2. Enter only a tag or a tag and its value.
  3. Select whether this tag is global or private and submit the workflow.
  4. The output is an array of workflows:

    Finding workflows by tag

How it works...

Tags have been integrated into Orchestrator since 5.5.1. There are two types of tags: global tags and private tags. A global tag is visible to all users whereas non-global (private) tags are only visible to the user who places the tag.

Tip

Tags can be used on workflows, actions, resources, configurations, packages, policy templates, and you can add them to inventory elements.

Tags are not stored with the workflows. Importing and exporting a workflow to a different Orchestrator will not preserve the tags; however, several websites state that this is the case.

There's more...

The JavaScript behind the tags is straightforward:

JavaScript tags

Function

Server.tagGlobally(taggedObject,tagName,tagValue );

This allows tagging an object with a global tag.

Server.tag(taggedObject,tagName,tagValue);

This allows tagging an object with a private tag.

Server.findGlobalTagsForObject(taggedObject);

This allows listing an object's global tags.

Server.findTagsForObject(taggedObject);

This allows listing an object's private tags.

Server.queryByTags(tagQuery,null);

This allows finding an object by its tags.

Server.untagGlobally(taggedObject,tags);

This allows untagging a global tag from an object.

Server.untag(taggedObject,tags);

This allows untagging a private tag from an object.

See also

For using vCenter tags see recipe Custom Attributes and Tags (vAPI) in Chapter 12, Working with vSphere.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset