Skip to content

Commit

Permalink
add tag name unique per job to CLI/API; address Phil's feedback
Browse files Browse the repository at this point in the history
Add partial explaining why tag, add to CLI/API
  • Loading branch information
aimeeu committed Oct 9, 2024
1 parent 746276e commit eb3eb83
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion website/content/api-docs/jobs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2702,6 +2702,8 @@ WebSocket Request: /v1/job/actions-demo/action?action=weather&allocID=8614ed07-4

This endpoint creates a tag for a job version.

@include 'version/tag-reason.mdx'

| Method | Path | Produces |
| ------ | ----------------- | ------------------ |
| `POST` | `/v1/job/:job_id/versions/:tag_name/tag` | `application/json` |
Expand All @@ -2711,7 +2713,7 @@ This endpoint creates a tag for a job version.
- `:job_id` `(string: <required>)` - The ID of the job. Specify `job_id` as part
of the path.
- `:tag_name` `(string: <required>)` - The new tag name for the
version specified in the payload. Specify `tag_name` as part of the path.
version specified in the payload. Must be unique per job. Specify `tag_name` as part of the path.
- `Version`: `(int: <optional>)` - The job version number. If not
specified, Nomad tags the latest version. Specify `Version` in the payload.
- `Description`: `(string: <optional>)` - The tag description. Specify `Description` in the payload.
Expand Down
8 changes: 4 additions & 4 deletions website/content/docs/commands/job/revert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ authentication.
nomad job revert [options] <job> <version|tag>
```

The `job revert` command requires two inputs, the job ID and the version or tag
of that job to revert to. When you specify a version number, Nomad reverts the
job to the exact version number. Alternately, when you specify a version tag,
Nomad reverts to the version with that tag.
The `job revert` command requires two inputs, the job ID and the version number
or tag of that job to revert to. When you specify a version number, Nomad
reverts the job to the exact version number. Alternately, when you specify a
version tag, Nomad reverts to the version with that tag.

When ACLs are enabled, this command requires a token with the `submit-job`
capability for the job's namespace. The `list-jobs` capability is required to
Expand Down
4 changes: 3 additions & 1 deletion website/content/docs/commands/job/tag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |

# Command: job tag

@include 'version/tag-reason.mdx'

Use the `job tag` command to manage tags for job versions. `job tag` has the
following subcommands:

Expand Down Expand Up @@ -38,7 +40,7 @@ nomad job tag apply [options] <job_id>

### Apply options

- `name`: Specifies the name of the tag.
- `name`: Specifies the name of the tag. Must be unique per job.
- `description`: If set, specifies a description for the tag.
- `version`: If set, specifies the version of the job to tag. If not provided, Nomad tags the latest version of the job.

Expand Down
4 changes: 4 additions & 0 deletions website/content/partials/version/tag-reason.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Applying a tag to a version prevents Nomad from garbage collecting that version.
You can compare versions by tag name as well as version number.

Tag names must be unique per job.

0 comments on commit eb3eb83

Please sign in to comment.