--- title: "Rename a source" canonical: "https://admiral.io/docs/api/sources/SourceAPI_RenameSource" --- # Rename a source `POST https://api.admiral.io/v1/sources/{source}/rename` Renaming a source needs permission to create sources; PERMISSION_DENIED otherwise. - ALREADY_EXISTS when another source has the new name. - ABORTED when `etag` is set and the source changed since it was read. Scope: `source:write` ### Path parameters - `source` (string, required): The source id. ### Request body - `new_name` (string, required): The new name, under the same rules as the source's `name`. new_name.not_uid // a source name may not have the shape of an id Pattern `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. Length 1 to 63. - `etag` (string): When set, the rename is refused unless it matches the source's current etag. ### Response 200 Success - `source` (Source): The source under its new name. - At most one of `connection_id`, `credential_id` is set. - `id` (string): `src-` and twelve base36 characters. Never changes and is never reused, so it is what a reference to the source holds. Pattern `^src-[0-9a-z]+$`. Read-only. - `name` (string, required): (IMMUTABLE) The name, such as `bitnami`. Unique among the organization's sources, set on create and changed only by RenameSource. Lowercase letters, digits and hyphens, starting with a letter and ending with a letter or digit, 1 to 63 characters. It may not have the shape of an id (`src-` and twelve characters). name.not_uid // a source name may not have the shape of an id Pattern `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. Length 1 to 63. - `display_name` (string): A label for people, such as "Bitnami charts". Optional; clients show the name when it is unset. Length at most 128. - `resource_name` (string): (IDENTIFIER) The resource name, `sources/{source}`, such as `sources/bitnami`. Built from the source's name, so it changes when the source is renamed; refer to a source by `id` to keep a reference stable. Identifies the source on update. Pattern `^sources/[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. - `description` (string): Length at most 1024. - `kind` (Kind): (IMMUTABLE) enum.defined_only = true One of `GIT`, `HELM_REPO`, `OCI_REGISTRY`, `TERRAFORM_REGISTRY`. - `location` (string): (IMMUTABLE) The narrowest thing the protocol addresses: one repository, one Helm repository URL, one registry namespace. Never a bare host, and never a whole GitHub organization. Picking the source is picking the grant, so the location is what bounds the grant's reach: no source presents its grant outside its own location. When an artifact depends on another private location, Admiral fetches the dependency with the grant of the source whose location covers it, within that source's `allows`, and with no grant when no source covers it. Length 1 to 512. - `trigger` (Trigger): enum.defined_only = true One of `REQUEST`, `PUSH`. - `allows` (array of string): What may enter through the source. Each entry is `[@]`: `argo-rollouts`, `modules/*`, `*`, `argo-rollouts@>=2.39`, `cert-manager@~1.16`. The name is exact or ends in `*`. For a git source an artifact is a path in the repository; for a Helm repository a chart name; for a registry a name under the namespace. Names match by whole path segments, with `*` only as the last segment, so `modules/*` admits `modules/network` and never `modules-evil`. The most specific entry that matches a name decides its versions, so `*` beside `argo-rollouts@>=2.39` still bounds argo-rollouts to 2.39 and up. An entry with a range admits only ordered versions inside it, so a branch or a commit needs an entry with no range. A range excludes pre-releases unless it names one. Required and never empty; `*` alone means everything, so no empty list stands for it. The Admiral CLI sends `*` when it is left off. An allow list, enforced by Admiral at import and at push, per artifact and per version: a version outside an entry's range is refused as an artifact outside `allows` is. Plan and apply do not check it again. Items 1 to 64. - `settings` (SourceSettings): The block for `kind`, where the kind has one. Only git has settings, and only a push source needs them. - `git` (GitSourceSettings): GitSourceSettings is what a git source adds: which branches and tags a push source publishes on, and how a tag names an artifact's version. A push source names at least one branch or tag. - `branches` (array of string): Branches whose pushes publish, exact or with a trailing `*`; `*` alone is every branch. Ignored on a request source. Every publish tags the version with the branch name, floating, and `sha-`. Items at most 32. - `tags` (array of string): Tags whose pushes publish, exact or with a trailing `*`, such as `v*`. A push of a matching tag publishes what admiral.yaml declares at the tagged commit, tags the version `sha-`, floating, and records the full git tag in the version's provenance `ref`. Without a `tag_template`, the git tag's own name is also the registry tag when it is a semver name the registry can hold, such as `v1.4.0`, and then it is immutable and a range or `latest` can match it. Any other name still publishes, carrying only `sha-`. With a template, the registry tag is the version the template extracts. A tag that matches nothing here is ignored, and empty means no tag push publishes. When the source also names branches, a tag publishes only if its commit is reachable from a branch listed there. Ignored on a request source. Items at most 32. - `tag_template` (string): How a tag names an artifact's version in a repository holding several, such as `{artifact}/v{version}` or `{name}-v{version}`. With it, an artifact's versions are the tags that fit, with the template stripped, and a tag push publishes only the component the tag names. The version is tagged with what the template extracts, `1.4.0` from `modules/network/v1.4.0` under `{artifact}/v{version}`, which makes it a semver tag and immutable; the full git tag stays in the version's provenance `ref`. Empty means every tag of the repository is a version of every artifact in it. string.contains = "{version}" Length at most 256. - `status` (Status): One of `STATUS_UNSPECIFIED`, `READY`, `NEEDS_ATTENTION`. Read-only. - `status_reason` (string): Why the status left READY. Empty while ready. Read-only. - `etag` (string): Changes whenever the source does. Send it back on update, rename or delete to refuse the change if someone else changed the source first. Read-only. - `created_by` (ActorRef): ActorRef is a lightweight reference to the user or agent that performed an action. Server-populated on all resource responses. Clients should never send this. Read-only. - `id` (string): The actor's typed id: a `usr-` user id or an `sa-` service account id. - `display_name` (string): Human-readable name (e.g., "John Smith", "deploy-bot"). - `email` (string): Email address (empty for non-human actors). - `created_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `updated_at` (Timestamp): A point in time in RFC 3339 format, with up to nanosecond precision. Output uses UTC (`Z`); input may use an offset from UTC. Read-only. - `connection_id` (string): Pattern `^con-[0-9a-z]+$`. - `credential_id` (string): Pattern `^cred-[0-9a-z]+$`.