-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathhelp.go
More file actions
62 lines (45 loc) · 2.79 KB
/
help.go
File metadata and controls
62 lines (45 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package api
import "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
var Usage = []string{"api <endpoint-path>"}
func GetDescription() string {
return "Invoke a JFrog Platform HTTP API using the configured server URL and credentials (hostname and token are not passed manually; use 'jf config' or --url / --access-token / --server-id as usual). REST API reference: " + coreutils.JFrogHelpUrl + "jfrog-platform-documentation/rest-apis (OpenAPI bundles are not shipped with the CLI)."
}
func GetArguments() string {
return ` endpoint-path
API path on the platform host (for example: /access/api/v1/users or /artifactory/api/repositories). The configured platform base URL is prepended automatically.
EXAMPLES
# List users (Access API)
$ jf api /access/api/v2/users
# Get a user by name
$ jf api /access/api/v2/users/admin
# Create a user (POST JSON body from a file, or use -d/--data for an inline body — not both)
$ jf api /access/api/v2/users -X POST --input ./user.json -H "Content-Type: application/json"
$ jf api /access/api/v2/users -X POST -d '{"name":"admin"}' -H "Content-Type: application/json"
# Replace a user
$ jf api /access/api/v2/users/newuser -X PUT --input ./user.json -H "Content-Type: application/json"
# Delete a user
$ jf api -X DELETE /access/api/v2/users/tempuser
# List local repositories (Artifactory REST)
$ jf api /artifactory/api/repositories
# Create a local Maven repository
$ jf api /artifactory/api/repositories/my-maven-local -X PUT -H "Content-Type: application/json" --input ./repo-maven-local.json
# Update repository configuration
$ jf api /artifactory/api/repositories/libs-release -X POST -H "Content-Type: application/json" --input ./repo-config.json
# Delete a repository
$ jf api /artifactory/api/repositories/old-repo -X DELETE
# One Model GraphQL
$ jf api /onemodel/api/v1/graphql -X POST -H "Content-Type: application/json" --input ./graphql-query.json
# Set a request timeout (seconds)
$ jf api /artifactory/api/repositories --timeout 10
OUTPUT
The response body is written to standard output. The HTTP status code is written to standard error as a single line. Non-2xx responses still print the body and exit with status 1.
REFERENCES
Binary Management (Artifactory): https://docs.jfrog.com/artifactory/reference/
JFrog Security : https://docs.jfrog.com/security/reference/
Governance (AppTrust) : https://docs.jfrog.com/governance/reference/
Integrations : https://docs.jfrog.com/integrations/reference/
Project Management : https://docs.jfrog.com/projects/reference/
Platform Administration : https://docs.jfrog.com/administration/reference/
SEE ALSO
Use 'jf config' to add or select a server. Use --server-id to target a specific configuration.`
}