Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Search





Overview

The following V2 REST APIs apply for Artifactory version 6.6.0 and above. They are extensions for existing REST APIs, with additional functionalities. 


BUILDS

Get Permission Targets

Description: Get the permission targets list for repository and build permission targets.
Since: 6.6.0
Notes: Requires Artifactory Pro. This REST API is also available for Artifactory versions below 6.6.
Security: Requires an admin user or a user with Manage permission on permission target
Usage: GET /api/v2/security/permissions
Producesapplication/vnd.org.jfrog.artifactory.security.PermissionTargetV2+json
Sample Output:

Page Contents

 

GET /api/v2/security/permissions
[
  {
    "name": "readSourceArtifacts"
    "uri" : "http://localhost:8081/artifactory/api/v2/security/permissions/readSourceArtifacts"
  }, {
    "name": "populateCaches"
    "uri" : "http://localhost:8081/artifactory/api/v2/security/permissions/populateCaches"
  }
]

Get Permission Target Details

Description: Get the details of an Artifactory Permission Target
Since: 6.6.0
Notes: Requires Artifactory Pro. This REST API is also available for Artifactory versions below 6.6.
Security: Requires an admin user or a user with Manage permission on permission target
Usage: GET /api/v2/security/permissions/{permissionTargetName}
Producesapplication/vnd.org.jfrog.artifactory.security.PermissionTargetV2+json
Sample Output:

GET /api/v2/security/permissions/populateCaches
{
permission-target.json
}

Permission Target existence check

Description: Get the existence details of an Artifactory Permission Target
Since: 6.6.0
Notes: Requires Artifactory Pro.
Security: Requires an admin user or a user with Manage permission on permission target
Usage: HEAD /api/v2/security/permissions/{permissionTargetName}
Produces: 200 OK in case it exists, 404 NOT FOUND in case it doesn't, with an empty response.
Sample Output:

HEAD /api/v2/security/permissions/populateCaches

200 OK
or
404 NOT FOUND

Create Permission Target

Description: Creates a new permission target in Artifactory or replaces an existing permission target
Since: 6.6.0
Notes: Requires Artifactory Pro
- Missing values will be set to the default values as defined by the consumed type.
To support spaces in the User or Group or Permission names, a Plus symbol ('+') is automatically placed when there is a space. This is set by default as the security.api.plus.insteadof.space property is set to true. If you want to use the + (plus) symbol, set the security.api.plus.insteadof.space to false.
Security: Requires an admin user
Usage: POST /api/v2/security/permissions/{permissionTargetName}  -H "Content-Type: application/json"
Consumesapplication/vnd.org.jfrog.artifactory.security.PermissionTargetV2+json
Produces201 CREATED in case of success, with an empty response.
Sample Usage
:

POST /api/v2/security/permissions/populateCaches -H "Content-Type: application/json"
{
permission-target.json
}

201 CREATED 

Update Permission Target

Description: Creates a new permission target in Artifactory or replaces an existing permission target
Since: 6.6.0
Notes: Requires Artifactory Pro
Missing permission target values will be set to the default values as defined by the consumed type.
The values defined in the request payload will replace what currently exists in the permission target entity. In case the request is missing one of the permission target entities (repo/build), the entity will be deleted. This means that if an update request is sent to an entity that contains both repo and build, with only repo, the build values will be removed from the entity.
Security: Requires an admin user or a user with Manage permission on permission target.
User with a Manage permission can only edit the actions.
Usage: PUT /api/v2/security/permissions/{permissionTargetName}
Consumesapplication/vnd.org.jfrog.artifactory.security.PermissionTargetV2+json
Produces200 OK in case of success, with an empty response.
Sample Usage
:

PUT /api/v2/security/permissions/populateCaches
{
permission-target.json
}

200 OK 

Get Permission Targets Per User

Description: Get the permission targets list for repository and build permission targets for a specific user.
Since: 6.9.0
Notes: Requires Artifactory Pro.
Security: Requires an admin user or a user with Manage permission on permission target
Usage: GET /api/v2/security/permissions/users/<user_name>
Sample Output:

[{
   "name": "permission-target-name",
   "repo": {
      "include-patterns": ["**"],
      "exclude-patterns": [""],
      "repositories": ["local-rep1", "local-rep2", "remote-rep1", "virtual-rep2"],
      "actions": ["read","write","manage"]
    }
    "build": {
      "include-patterns": [""],
      "exclude-patterns": [""],
      "repositories": ["artifactory-build-info"],
      "actions": ["read","manage"]
    }
},
{...}, 
{...}]

Get Permission Targets Per Group

Description: Get the permission targets list for the repository and build permission targets for a specific group.
Since: 6.9.0
Notes: Requires Artifactory Pro.
To support spaces in the User or Group or Permission names, a Plus symbol ('+') is automatically placed when there is a space. This is set by default as the security.api.plus.insteadof.space property is set to true. If you want to use the + (plus) symbol, set the security.api.plus.insteadof.space to false.
Security: Requires an admin user or a user with Manage permission on permission target
Usage: GET /api/v2/security/permissions/groups/<group_name>
Sample Output:

[{
   "name": "permission-target-name",
   "repo": {
      "include-patterns": ["**"],
      "exclude-patterns": [""],
      "repositories": ["local-rep1", "local-rep2", "remote-rep1", "virtual-rep2"],
      "actions": ["read","write","manage"]
    }
    "build": {
      "include-patterns": [""],
      "exclude-patterns": [""],
      "repositories": ["artifactory-build-info"],
      "actions": ["read","manage"]
    }
},
{...}, 
{...}]


Delete Permission Target

Description: Deletes an Artifactory permission target.
Since: 6.6.0
Notes: Requires Artifactory Pro
To support spaces in the User or Group or Permission names, a Plus symbol ('+') is automatically placed when there is a space. This is set by default as the security.api.plus.insteadof.space property is set to true. If you want to use the + (plus) symbol, set the security.api.plus.insteadof.space to false.
Security: Requires an admin user
Usage: DELETE /api/v2/security/permissions/{permissionTargetName}
Produces200 OK in case of success, with an empty response.
Sample usage:

DELETE /api/v2/security/permissions/populateCaches

200 OK

REPOSITORIES

Repository Configuration

Description: Returns the current configuration of a repository. Supported by local, remote and virtual repositories. Contrary to Artifactory REST API - this API will return only relevant fields.
Since: 6.12.0
Security: Requires an admin user for complete repository configuration. Non-admin users will receive only partial configuration data.
Usage: GET /api/v2/repositories/{repoKey}
Produces: application/json (application/vnd.org.jfrog.artifactory.repositories.LocalRepositoryConfiguration+json), application/json (application/vnd.org.jfrog.artifactory.repositories.RemoteRepositoryConfiguration+json),
application/json (application/vnd.org.jfrog.artifactory.repositories.VirtualRepositoryConfiguration+json)

{
  "key" : "generic-local",
  "type" : "local",
  "packageType" : "generic",
  "description" : "",
  "notes" : "",
  "includesPattern" : "**/*",
  "excludesPattern" : "",
  "repoLayoutRef" : "maven-2-default",
  "blackedOut" : false,
  "propertySets" : [ ],
  "archiveBrowsingEnabled" : false,
  "downloadRedirect" : false,
  "xrayIndex" : false,
  "cdnRedirect" : false
}
  • No labels
Copyright © 2021 JFrog Ltd.