### Install Harbor from Source Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/use-make.md Use this command to compile binaries, build images, prepare the compose file, and start a Harbor instance. ```sh make install ``` -------------------------------- ### Example: Get Artifact Info by Reference Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-info.md This example demonstrates how to retrieve information for a specific artifact using its project, repository, and reference. ```sh harbor artifact info // ``` -------------------------------- ### Harbor CLI Artifact Scan Start Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-scan-start.md Displays help information for the `start` subcommand of `harbor artifact scan`. ```sh harbor artifact scan start --help ``` -------------------------------- ### Install Harbor with Cosign Enabled Source: https://github.com/goharbor/website/blob/main/content/blog/cosign-2.5.0.md This command installs Harbor along with Cosign and Notary support. Ensure you are using the offline installer script. ```bash # ./install.sh --with-notary --with-trivy [Step 0]: checking if docker is installed ... ... ... ... [Step 5]: starting Harbor ... Creating network "harbor_harbor" with the default driver Creating network "harbor_harbor-notary" with the default driver Creating network "harbor_notary-sig" with the default driver Creating harbor-log ... done Creating harbor-portal ... done Creating redis ... done Creating registryctl ... done Creating registry ... done Creating harbor-db ... done Creating trivy-adapter ... done Creating notary-signer ... done Creating harbor-core ... done Creating harbor-jobservice ... done Creating nginx ... done Creating notary-server ... done ✔ ----Harbor has been installed and started successfully.---- ``` -------------------------------- ### Harbor CLI Context Get Command Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-context.md Displays help information for the 'context get' command, which is used to retrieve a specific configuration item. ```bash harbor context get ``` -------------------------------- ### Example: Get Harbor Health Status Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-health.md This is a basic example demonstrating how to invoke the 'harbor health' command to retrieve component health. ```sh # Get the health status of Harbor components ``` -------------------------------- ### Example Harbor CLI Configuration File Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-config/_index.md A sample configuration file showing how to define credentials and set the active one. ```yaml current-credential-name: example@demo-harbor credentials: - name: example@demo-harbor username: example-user password: example-password serveraddress: https://demo.goharbor.io ``` -------------------------------- ### Verify Harbor Installation Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/compile-guide.md This message indicates that Harbor has been successfully built, installed, and started. You can now access Harbor through your web browser. ```sh ... Start complete. You can visit harbor now. ``` -------------------------------- ### Install npm Dependencies Source: https://github.com/goharbor/website/blob/main/README.md Install the necessary Node.js dependencies for the website project using npm. ```sh npm i ``` -------------------------------- ### Default Harbor Installation Source: https://github.com/goharbor/website/blob/main/docs/install-config/run-installer-script.md Run this command for a standard Harbor installation without the Trivy service. Ensure `harbor.yml` is configured beforehand. ```bash sudo ./install.sh ``` -------------------------------- ### Example GPG Verification Output Source: https://github.com/goharbor/website/blob/main/docs/install-config/download-installer.md This is an example output from the GPG verification command, indicating a good signature from the Harbor signing key. It also includes warnings about the key's trust level. ```text gpg: armor header: Version: GnuPG v1 gpg: assuming signed data in 'harbor-online-installer-v2.0.2.tgz' gpg: Signature made Tue Jul 28 09:49:20 2020 UTC gpg: using RSA key 644FF454C0B4115C gpg: using pgp trust model gpg: Good signature from "Harbor-sign (The key for signing Harbor build) " [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 7722 D168 DAEC 4578 06C9 6FF9 644F F454 C0B4 115C gpg: binary signature, digest algorithm SHA1, key algorithm rsa4096 ``` -------------------------------- ### Create a Simple Dockerfile Source: https://github.com/goharbor/website/blob/main/docs/install-config/demo-server.md This is a basic Dockerfile example. It uses the busybox image as a base and is suitable for testing image building and pushing to Harbor. ```dockerfile FROM busybox:latest ``` -------------------------------- ### Start Harbor Source: https://github.com/goharbor/website/blob/main/docs/install-config/reconfigure-manage-lifecycle.md Use this command to start all Harbor services after they have been stopped. Ensure you are in the directory with `docker-compose.yml`. ```sh sudo docker compose start Starting log ... done Starting registry ... done Starting registryctl ... done Starting postgresql ... done Starting core ... done Starting portal ... done Starting redis ... done Starting jobservice ... done Starting proxy ... done ``` -------------------------------- ### Interactive Project Configuration Update Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-update.md Example of running the project configuration update command interactively without any flags. ```bash harbor-cli project config update ``` -------------------------------- ### Install Harbor HA Helm Chart (Helm 3) Source: https://github.com/goharbor/website/blob/main/docs/install-config/harbor-ha-helm.md Use this command to install the Harbor HA Helm chart with Helm 3. Ensure you have Helm 3 installed and configured. ```bash helm install my-release harbor/ ``` -------------------------------- ### Install NPM Packages Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/ui-contribution-get-started.md Installs necessary npm packages and third-party dependencies for the frontend development environment. ```sh npm install ``` -------------------------------- ### Install Helm Chart from OCI Registry Source: https://github.com/goharbor/website/blob/main/docs/working-with-projects/working-with-oci/working-with-helm-oci-charts.md Deploy a Helm chart directly from an OCI registry using `helm install`. This command requires the release name, OCI URL, chart name, and version. Authentication is necessary for private registries. ```sh helm install oci://// --version ``` ```sh helm install MyRelease oci://demo.goharbor.io/oci/demo --version 0.1.0 ``` -------------------------------- ### Prepare Harbor for HTTPS Source: https://github.com/goharbor/website/blob/main/docs/install-config/configure-https.md Run the `prepare` script from the Harbor installer bundle to configure the Nginx reverse proxy for HTTPS. ```bash ./prepare ``` -------------------------------- ### Create Artifact Tag with Configuration and Output Options Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-tags-create.md This example shows how to specify a configuration file and an output format when creating an artifact tag. The output can be in JSON or YAML format. ```sh harbor artifact tags create --config "$HOME/.config/harbor-cli/config.yaml" --output-format json // ``` -------------------------------- ### Update Multiple Project Settings Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-update.md Example of updating multiple project configuration settings in a single command. ```bash harbor-cli project config update myproject --public false --prevent-vul true --severity high ``` -------------------------------- ### Log in and Push Docker Images to Harbor Source: https://github.com/goharbor/website/blob/main/docs/install-config/run-installer-script.md After successful installation, use these Docker commands to log in to your Harbor instance and push images to a project. Replace `reg.yourdomain.com` and `myproject/myrepo:mytag` with your specific details. ```bash docker login reg.yourdomain.com ``` ```bash docker push reg.yourdomain.com/myproject/myrepo:mytag ``` -------------------------------- ### Demonstrate Read-Only Mode Source: https://github.com/goharbor/website/blob/main/docs/administration/general-settings/_index.md This example shows the output when a user attempts to push an image to a Harbor registry that is configured in read-only mode. The system prevents modifications. ```sh docker push 10.117.169.182/demo/ubuntu:14.04 The push refers to a repository [10.117.169.182/demo/ubuntu] 0271b8eebde3: Preparing denied: The system is in read only mode. Any modification is prohibited. ``` -------------------------------- ### Start Harbor with Docker Compose Source: https://github.com/goharbor/website/blob/main/docs/install-config/customize-token-service.md After replacing the certificate files, restart Harbor using Docker Compose to apply the new configuration. ```sh docker compose up -d ``` -------------------------------- ### List repositories in a project Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo-list.md Use this command to get information about all repositories within a specific project. Replace `` with the actual name of your project. ```sh harbor repo list ``` -------------------------------- ### Temporary Config Override Example Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-config/_index.md Demonstrates overriding the default configuration for a specific command using the `--config` flag. ```bash harbor --config ./experimental.yaml project create "new-project" ``` -------------------------------- ### Serve Harbor Locally Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/ui-contribution-get-started.md Starts the local Harbor development server. After execution, the Harbor frontend can be accessed at https://localhost:4200. ```sh npm run start ``` -------------------------------- ### Harbor CLI Global Options Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-scan-start.md These are global options that can be used with the `harbor artifact scan start` command, including configuration file path, output format, and verbosity. ```sh harbor artifact scan start -c "$HOME/.config/harbor-cli/config.yaml" -o json -v ``` -------------------------------- ### Build Harbor with Official Golang Image Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/compile-guide.md Compile, install, and run Harbor using an official Golang Docker image. This method ensures a consistent build environment. ```sh make install COMPILETAG=compile_golangimage ``` -------------------------------- ### Stop scan-all and check metrics Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scan-all-stop.md This example demonstrates stopping the scan-all operation and then immediately checking the scan metrics to confirm the action. ```bash harbor-cli scan-all stop && harbor-cli scan-all metrics ``` -------------------------------- ### List repositories with pagination and query options Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo-list.md This example shows how to list repositories with specific pagination and query parameters. You can control the page number, page size, and filter results using a query string. ```sh harbor repo list --page 2 --page-size 20 -q "my-repo" ``` -------------------------------- ### Extract Harbor Installer Package Source: https://github.com/goharbor/website/blob/main/docs/install-config/download-installer.md Extract the contents of the downloaded Harbor installer package using the tar command. This prepares the installer files for the installation process. ```bash bash $ tar xzvf harbor-online-installer-version.tgz ``` ```bash bash $ tar xzvf harbor-offline-installer-version.tgz ``` -------------------------------- ### Load Harbor Prepare Image from Offline Package Source: https://github.com/goharbor/website/blob/main/docs/administration/upgrade/_index.md If using an offline installer, load the `goharbor/prepare` image from the provided tarball. Replace `` and `[version]` accordingly. ```sh tar zxf docker image load -i harbor/harbor.[version].tar.gz ``` -------------------------------- ### Harbor Instance CLI Help Options Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-instance.md Displays help information for the 'harbor instance' command. Use this to see available subcommands and their basic usage. ```sh -h, --help help for instance ``` -------------------------------- ### Start Artifact Scan Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-scan.md Initiates a scan for a specific artifact in a Harbor repository. Replace // with your artifact's details. ```sh harbor artifact scan start // ``` -------------------------------- ### List repositories with sorting and output format Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo-list.md This example demonstrates how to sort the repository list and specify the output format. The `--sort` flag can be used for ascending or descending order, and `--output-format` can be set to 'json' or 'yaml'. ```sh harbor repo list --sort name --output-format json ``` -------------------------------- ### Run Local Hugo Server Source: https://github.com/goharbor/website/blob/main/README.md Start the local Hugo development server to preview the website. The server runs on http://localhost:1313 and automatically refreshes on file changes. ```sh make serve ``` -------------------------------- ### Configure Harbor Build Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/compile-guide.md Copy the template configuration file and edit it to customize Harbor's settings before building. Refer to the Harbor Installation and Configuration documentation for detailed options. ```sh cd harbor vi make/harbor.yml ``` -------------------------------- ### Install Harbor HA Helm Chart (Helm 2) Source: https://github.com/goharbor/website/blob/main/docs/install-config/harbor-ha-helm.md Use this command to install the Harbor HA Helm chart with Helm 2. Ensure you have Helm 2 installed and configured. ```bash helm install --name my-release harbor/ ``` -------------------------------- ### Package Offline Installer Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/use-make.md This command prepares an offline installation package for Harbor. ```sh make package_offline ``` -------------------------------- ### Build and Tag Docker Image Source: https://github.com/goharbor/website/blob/main/docs/install-config/demo-server.md Build a Docker image from the Dockerfile and tag it with the demo Harbor registry path and your project name. Replace 'your-project' with your actual project name. ```sh docker build -t demo.goharbor.io/your-project/test-image . ``` -------------------------------- ### Build Harbor with Local Golang Environment Source: https://github.com/goharbor/website/blob/main/docs/build-customize-contribute/compile-guide.md Compile, install, and run Harbor after setting up your local Go environment and placing the source code in the correct directory. Ensure you navigate to the Harbor source directory first. ```sh cd $GOPATH/src/github.com/goharbor/harbor $ make install ``` -------------------------------- ### Get Repository Information Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo-info.md Use this command to fetch details for a specific repository within a project. Replace / with your actual project and repository names. ```sh harbor repo info / ``` -------------------------------- ### Harbor CLI Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project.md Displays help information for the 'project' command. ```sh harbor project --help ``` -------------------------------- ### Configure Docker Daemon with Harbor Certificates Source: https://github.com/goharbor/website/blob/main/docs/install-config/configure-https.md Create a directory for your Harbor domain under `/etc/docker/certs.d/` and copy all necessary certificate files into it. ```bash mkdir -p /etc/docker/certs.d/yourdomain.com/ cp yourdomain.com.cer /etc/docker/certs.d/yourdomain.com/ cp yourdomain.com.key /etc/docker/certs.d/yourdomain.com/ cp ca.crt /etc/docker/certs.d/yourdomain.com/ ``` -------------------------------- ### Harbor CLI Context Command Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-context.md Displays help information for the 'context' command, outlining its available options. ```bash harbor context delete ``` -------------------------------- ### Example OCI Image Index Structure Source: https://github.com/goharbor/website/blob/main/docs/working-with-projects/working-with-images/deleting-artifact.md This JSON structure represents an example of an OCI image index, which can contain multiple image manifests for different platforms. ```json { "schemaVersion": 2, "manifests": [ { "mediaType": "application/vnd.oci.image.manifest.v1+json", "size": 7143, "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f", "platform": { "architecture": "ppc64le", "os": "linux" } }, { "mediaType": "application/vnd.oci.image.manifest.v1+json", "size": 7682, "digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270", "platform": { "architecture": "amd64", "os": "linux" } } ], "annotations": { "com.example.key1": "value1", "com.example.key2": "value2" } } ``` -------------------------------- ### Harbor Installation with Trivy Source: https://github.com/goharbor/website/blob/main/docs/install-config/run-installer-script.md To include the Trivy vulnerability scanner in your Harbor installation, use the `--with-trivy` flag with the `install.sh` script. This requires prior configuration of `harbor.yml`. ```bash sudo ./install.sh --with-trivy ``` -------------------------------- ### Reconfigure Harbor: Install Trivy Source: https://github.com/goharbor/website/blob/main/docs/install-config/reconfigure-manage-lifecycle.md When reconfiguring Harbor, you can include additional components like Trivy by passing them to the prepare script. This command installs Trivy alongside other Harbor components. ```sh sudo ./prepare --with-trivy ``` -------------------------------- ### List Project Configuration in JSON Format Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-list.md Lists the configuration of a Harbor project and formats the output as JSON. This is useful for machine-readable output and integration with other tools. ```bash harbor-cli project config list myproject --output-format json ``` -------------------------------- ### Verify Harbor Installer Package Signature Source: https://github.com/goharbor/website/blob/main/docs/install-config/download-installer.md Verify the integrity and authenticity of the downloaded Harbor installer package using its corresponding .asc signature file. This command checks if the package has been tampered with. ```bash gpg -v --keyserver hkps://keyserver.ubuntu.com --verify harbor-online-installer-version.tgz.asc ``` ```bash gpg -v --keyserver hkps://keyserver.ubuntu.com --verify harbor-offline-installer-version.tgz.asc ``` -------------------------------- ### Help for Switch Command Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-context-switch.md Displays help information for the 'harbor context switch' command. ```sh harbor context switch --help ``` -------------------------------- ### Reconfigure Harbor: Recreate and Start Source: https://github.com/goharbor/website/blob/main/docs/install-config/reconfigure-manage-lifecycle.md After stopping Harbor and preparing the configuration, use this command to recreate and start the Harbor instance with the updated settings. The `-d` flag runs containers in detached mode. ```sh sudo docker compose up -d ``` -------------------------------- ### Load Documentation Content Locally Source: https://github.com/goharbor/website/blob/main/README.md Use the `make prepare` command to copy the Markdown content from the `docs` folder and `release-X` branches into the local `content` folder for processing by Hugo. ```sh make prepare ``` -------------------------------- ### Get Scan All Metrics Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves metrics for the scan all operation. ```APIDOC ## GET /scans/all/metrics ### Description Retrieves metrics for the scan all operation. ### Method GET ### Endpoint /scans/all/metrics ``` -------------------------------- ### Harbor CLI Project Config List Help Flag Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-list.md Displays help information for the 'list' subcommand within 'harbor project config'. ```bash -h, --help help for list ``` -------------------------------- ### Disable and Rename Scanner Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scanner-update.md Example of disabling a scanner and renaming it simultaneously. ```sh harbor scanner update trivy-scanner --name "trivy-secure" --disabled ``` -------------------------------- ### Get Scan Schedule Metrics Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves metrics for the scan schedule. ```APIDOC ## GET /scans/schedule/metrics ### Description Retrieves metrics for the scan schedule. ### Method GET ### Endpoint /scans/schedule/metrics ``` -------------------------------- ### Download Harbor Helm Chart Source: https://github.com/goharbor/website/blob/main/docs/install-config/harbor-ha-helm.md Use these commands to add the Harbor Helm repository and fetch the Harbor chart for customization. ```bash helm repo add harbor https://helm.goharbor.io helm fetch harbor/harbor --untar ``` -------------------------------- ### Get Replication Policy Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves a specific replication policy by its ID. ```APIDOC ## GET /replication/policies/{id} ### Description Retrieves a specific replication policy by its ID. ### Method GET ### Endpoint /replication/policies/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the replication policy ``` -------------------------------- ### Create Robot Account from Configuration File Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-robot-create.md Load robot account configuration, including name, duration, project, and permissions, from a YAML or JSON file. This simplifies complex configurations. ```bash harbor-cli project robot create --robot-config-file ./robot-config.yaml ``` -------------------------------- ### Get Replication Adapter Info Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves information about replication adapters. ```APIDOC ## GET /replication/adapterinfos ### Description Retrieves information about replication adapters. ### Method GET ### Endpoint /replication/adapterinfos ``` -------------------------------- ### Get Current Configuration Source: https://github.com/goharbor/website/blob/main/docs/install-config/configure-system-settings-cli.md Retrieves the current system configuration of Harbor. ```APIDOC ## Get Current Configuration ### Description Retrieves the current system configuration of Harbor. ### Method GET ### Endpoint /api/v2.0/configurations ### Request Example ```sh curl -u ":" -H "Content-Type: application/json" -ki /api/v2.0/configurations ``` ``` -------------------------------- ### List All Harbor Contexts Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-context-list.md Use this command to display all configured Harbor contexts. This is useful for understanding your current connection settings. ```bash harbor context list ``` -------------------------------- ### Get Robot Account Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves details of a specific robot account by its ID. ```APIDOC ## GET /robots/{robot_id} ### Description Retrieves details of a specific robot account. ### Method GET ### Endpoint /robots/{robot_id} ### Parameters #### Path Parameters - **robot_id** (integer) - Required - The ID of the robot account to retrieve. ### Response #### Success Response (200) - **id** (integer) - The ID of the robot account. - **name** (string) - The name of the robot account. - **description** (string) - The description of the robot account. - **permissions** (array) - The permissions granted to the robot account. - **expires_at** (integer) - The expiration time of the robot account. - **creation_time** (string) - The creation time of the robot account. - **update_time** (string) - The update time of the robot account. #### Response Example ```json { "id": 1, "name": "my-robot-account", "description": "Robot account for CI/CD", "permissions": [ { "kind": "project", "resource": "my-project", "action": "pull" } ], "expires_at": 1678886400, "creation_time": "2023-03-15T10:00:00Z", "update_time": "2023-03-15T10:00:00Z" } ``` ``` -------------------------------- ### Get Robot Account Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves details for a specific robot account by its ID. ```APIDOC ## GET /robots/{robot_id} ### Description Retrieves a specific robot account by its ID. ### Method GET ### Endpoint /robots/{robot_id} ### Parameters #### Path Parameters - **robot_id** (integer) - Required - The ID of the robot account to retrieve. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the robot account. - **name** (string) - The name of the robot account. - **description** (string) - The description of the robot account. - **creation_time** (string) - The timestamp when the robot account was created. - **last_time** (string) - The timestamp when the robot account was last modified. - **expires_at** (integer) - The expiration timestamp of the robot account. - **level** (string) - The level of the robot account. - **project_id** (integer) - The ID of the project the robot account belongs to. - **permissions** (array) - A list of permissions granted to the robot account. #### Response Example ```json { "id": 1, "name": "robot1", "description": "Robot account for CI/CD", "creation_time": "2023-10-27T10:00:00Z", "last_time": "2023-10-27T10:00:00Z", "expires_at": 1700000000, "level": "system", "project_id": null, "permissions": [ { "kind": "repository", "action": "pull", "resource": "*" } ] } ``` ``` -------------------------------- ### Create Project Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Creates a new project in Harbor. ```APIDOC ## POST /projects ### Description Creates a new project. ### Method POST ### Endpoint /projects ``` -------------------------------- ### Help Option for Search Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-search.md Displays help information for the 'harbor project search' command. ```bash harbor project search --help ``` -------------------------------- ### Get Robot Account Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves details of a specific robot account by its ID. ```APIDOC ## GET /robots/{robot_id} ### Description Retrieves the details of a specific robot account, identified by its ID. ### Method GET ### Endpoint /robots/{robot_id} ### Parameters #### Path Parameters - **robot_id** (integer) - Required - The ID of the robot account to retrieve. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the robot account. - **name** (string) - The name of the robot account. - **description** (string) - The description of the robot account. - **project_id** (integer) - The ID of the project the robot account belongs to. - **creation_time** (string) - The timestamp when the robot account was created. - **update_time** (string) - The timestamp when the robot account was last updated. #### Response Example ```json { "id": 1, "name": "robot1", "description": "Robot account for CI/CD", "project_id": 10, "creation_time": "2023-10-27T10:00:00Z", "update_time": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Harbor Repo Command Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo.md Displays help information for the 'harbor repo' command. ```sh harbor repo --help ``` -------------------------------- ### Get Robot Account Permissions Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves the permissions associated with a specific robot account. ```APIDOC ## GET /robots/{robot_id}/permissions ### Description Retrieves the list of permissions granted to a specific robot account. ### Method GET ### Endpoint /robots/{robot_id}/permissions ### Parameters #### Path Parameters - **robot_id** (integer) - Required - The ID of the robot account whose permissions are to be retrieved. ### Response #### Success Response (200) - **permissions** (array) - A list of permission objects. - **kind** (string) - The type of resource the permission applies to. - **project** (object) - Project-level permissions details. - **id** (integer) - The ID of the project. - **name** (string) - The name of the project. - **actions** (array) - A list of actions allowed for the project. - **repository** (object) - Repository-level permissions details. - **name** (string) - The name of the repository. - **project** (string) - The name of the project the repository belongs to. - **actions** (array) - A list of actions allowed for the repository. #### Response Example ```json { "permissions": [ { "kind": "project", "project": { "id": 10, "name": "my-project", "actions": ["read", "create"] } }, { "kind": "repository", "repository": { "name": "my-app", "project": "my-project", "actions": ["pull", "push"] } } ] } ``` ``` -------------------------------- ### Update Scanner Authentication and Credential Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scanner-update.md Example of changing the authentication method and providing a credential for a scanner. ```sh harbor scanner update trivy-scanner --auth Basic --credential "base64encodedAuth" ``` -------------------------------- ### Update Scanner Description and URL Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scanner-update.md Example of updating the description and URL for a scanner named 'trivy-scanner'. ```sh harbor scanner update trivy-scanner --description "Updated scanner" --url "http://trivy.local:8080" ``` -------------------------------- ### Get Metrics for Latest Scan Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scan-all-metrics.md Retrieves comprehensive metrics about the most recent vulnerability scan execution. ```bash harbor scan-all metrics ``` -------------------------------- ### Harbor Project Config Help Options Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config.md Displays help information and options for the harbor project config command. Use project ID or name for identification. ```sh -h, --help help for config --id Use project ID instead of name ``` -------------------------------- ### Update Project Visibility to Public Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-update.md Example of updating a project's visibility to public using the CLI. ```bash harbor-cli project config update myproject --public true ``` -------------------------------- ### Get Scan Log Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves the scan log for a specific artifact within a project's repository. ```APIDOC ## GET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log ### Description Retrieves the scan log for a specific artifact. ### Method GET ### Endpoint /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log ### Parameters #### Path Parameters - **project_name** (string) - Required - The name of the project. - **repository_name** (string) - Required - The name of the repository. - **reference** (string) - Required - The artifact reference (e.g., tag or digest). - **report_id** (string) - Required - The ID of the scan report. ### Response #### Success Response (200) - **log** (string) - The scan log content. ``` -------------------------------- ### Read User Source: https://github.com/goharbor/website/blob/main/docs/administration/robot-accounts/_index.md Retrieves information about a specific user. Use this endpoint to get details of a user by their ID. ```APIDOC ## GET /users/{user_id} ### Description Reads a user. ### Method GET ### Endpoint /users/{user_id} ``` -------------------------------- ### Harbor CLI Help Option Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-registry.md Displays help information for the 'registry' command. This is useful for understanding available subcommands and options. ```sh -h, --help help for registry ``` -------------------------------- ### Get Metrics for Latest Scheduled Scan Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-scan-all-metrics.md Retrieves metrics specifically for the most recent scan that was triggered by a schedule. ```bash harbor scan-all metrics --scheduled ``` -------------------------------- ### List Project Configuration by ID Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-list.md Lists the configuration of a specific Harbor project using its ID. Use this when you know the project's numerical ID. ```bash harbor-cli project config list 123 ``` -------------------------------- ### List Command with Configuration Option Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-cve-allowlist-list.md Lists the system CVE allowlist using a specified configuration file. The default configuration file path is $HOME/.config/harbor-cli/config.yaml. ```sh harbor cve-allowlist list -c "$HOME/.config/harbor-cli/config.yaml" ``` -------------------------------- ### List Quotas Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-quota.md Lists all quotas for projects. Use this command to get an overview of current quota settings. ```sh harbor quota list ``` -------------------------------- ### List Harbor Registries Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-registry.md Lists all available registries in Harbor. Use this command to get an overview of your configured registries. ```sh harbor registry list ``` -------------------------------- ### List Project Configuration by Name Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-project-config-list.md Lists the configuration of a specific Harbor project using its name. This is the standard way to retrieve project configuration. ```bash harbor-cli project config list myproject ``` -------------------------------- ### Get Registry Info Command Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-registry-info.md This is the base command to retrieve registry information. Use flags to customize output. ```sh harbor registry info [flags] ``` -------------------------------- ### Create a Harbor Registry Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-registry-create.md Use this command to create a new registry. No arguments are required for a basic creation, but flags can be used to specify details like name, URL, and credentials. ```bash harbor registry create ``` -------------------------------- ### Delete Label with Verbose Output Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-label-delete.md Enable verbose output when deleting a label to get more detailed information about the operation. ```sh harbor label delete [labelname] -v ``` -------------------------------- ### Harbor CLI Help for Info Command Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-repo-info.md Displays help information for the 'harbor repo info' command. ```sh harbor repo info --help ``` -------------------------------- ### Harbor CLI Context Switch Command Help Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-context.md Displays help information for the 'context switch' command, used to change the active context. ```bash harbor context switch ``` -------------------------------- ### Get Artifact Info Synopsis Source: https://github.com/goharbor/website/blob/main/content/cli-docs/cli-docs/harbor-artifact-info.md This is the basic synopsis for the 'harbor artifact info' command. It shows the command structure. ```sh harbor artifact info [flags] ```