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







You are viewing an old version of this page. View thecurrent version.

Compare with CurrentView Page History

« PreviousVersion 48Next »

Overview

Requires an Enterprise or Enterprise+ license.

Mission Control exposes a rich REST API to allow fully automated management of registered JFrog PlatformDeployments(JPDs).

This provides a convenient and up-to-date self-descriptive API and can be used by various tools to automate administration and configuration actions.

Base URL

The Mission Control REST URL is constructed of:

://api/

For example, aV1API:

http://SERVER_HOSTNAME:8082/mc/api/v1 #or, on your local machine: http://localhost:8082/mc/api/v1

For example, aV3API:

http://SERVER_HOSTNAME:8082/mc/api/v3 #or, on your local machine: http://localhost:8082/mc/api/v3

Authentication

Mission Control's REST API supports authentication types:

Type Description
Access Token

Users have to use access token as a bearer token in the authorization header.

Example of authentication using the Bearer token:

    1. Create the Access Token to use for MC:

      curl -X POST -d 'username=' -d 'scope=applied-permissions/user' -d 'audience=jfmc@*' -d 'expires_in=3600' -d 'grant_type=client_credentials' http://localhost:8082/access/api/v1/oauth/token -H 'Authorization: Bearer '
    2. Run

      curl http://localhost:8082/mc/api/v1/jpds -H 'Authorization: Bearer '



Usage

Mission Control REST API can be invoked in any of the standard ways for a REST API.The following section describes how to use the Mission Control REST API using cURL as an example.

Using and configuring cURL

You can download cURL here. Learn how to use and configure cURL here.

Example - Create JPD

The example below demonstrates how to invoke the create userREST API.

  • You have MissionControl running within your local JPD

  • You wish to create another JPD called "us-west"

  • You created a file with the site's parameters calledcreatejpd.json

To use the file to register this new JPD, you would use the following command:

Using cURL with the REST API
curl - x美元后'http://localhost:8082/mc/api/v1/jpds' -H 'Authorization: Bearer ' -H 'Content-Type: application/json; charset=UTF-8' -T createjpd.json
The file createsite.json will contain the following :
{ "name": "us-west", "url" : "http://somehost", "token" : "xxx", "location": { "city": "Sunnyvale", "country_code": "US", "latitude": 37.368830, "longitude": -122.036350 } }
Page Contents

Read More


SYSTEM

System Health Check

Description: Get an indication if Mission Control is running or not. No authentication required.
Since:4.0
Usage:GET /api/v1/system/ping
SampleResponse:

OK


PROXIES (Deprecated)

Create Proxy(Deprecated)

Description:Adds a proxy.
Since:3.2
Security:Requires an admin user
Usage:POST /api/v3/proxies

Consumes:application/json

Sample Response:

{ "name" : "proxy-01", "url" : "http://proxyurl:8080", "sites" : [ { "source_site" : "source-Site", "destination_site" : "destination-Site" } ], "username" : "username", "password" : "password" }


Example:

$ curl 'http://localhost:8080/api/v3/proxies' -i -u 'admin:password' -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{ "name" : "proxy-01", "url" : "http://proxyurl:8080", "sites" : [ { "source_site" : "source-Site", "destination_site" : "destination-Site" } ], "username" : "username", "password" : "password" }



Create External Proxy (Deprecated)

Description:Adds an external proxy.
Since:3.2
Security:Requires an admin user
Usage:POST /api/v3/proxies
Consumes:application/json

Sample Response:

{ "name" : "proxy-01", "url" : "http://proxyurl:8080", "sites" : [ { "source_site" : "source-Site" } ], "username" : "username", "password" : "password" }

Update Proxy by Name (Deprecated)

Description:Updates a proxy.
Since:3.2
Security:Requires an admin user
Usage:POST /api/v3/proxies/{name}
Consumes:application/json

Sample Response:

{ "name" : "proxy-01-1", "url" : "http://a53dacff-7d2a-4991-bea0-231abe891e52:8080", "sites" : [ { "source_site" : "source-Site2", "destination_site" : "destination-Site2" } ], "username" : "username1", "password" : "password1" }



Get List of Proxies (Deprecated)

Description:Get the list of proxies.
Since:3.2
Security:Requires an admin user
Usage:Get /api/v3/proxies
Consumes:application/json
SampleResponse:

[ { "name" : "proxy-01", "url" : "http://ff121cae-f1f1-4639-85ff-cb07c744c730", "sites" : [ { "source_site" : "source-site-name", "destination_site" : "destination-site-name" } ] }, { "name" : "proxy-02", "url" : "http://14dc60cb-e3c2-476f-b4a6-263adf70a34d", "sites" : [ { "source_site" : "source-site-name" } ] } ]


Command line:


$ curl 'http://localhost:8080/api/v3/proxies' -i -u 'admin:password' -H 'Content-Type: application/json; charset=UTF-8'



Get List of Proxies Filtered by Source Service (Deprecated)

Description:Get the list of proxies by source service.
Since:3.2
Security:Requires an admin user
Usage:GET /api/v3/proxies?src_service={service_name}
Consumes:application/json
Sample Response:

[ { "name" : "proxy-01", "url" : "http://cfc3cf06-18b2-414c-a3e7-12dfd593201d", "sites" : [ { "source_site" : "source-site-name", "destination_site" : "destination-site-name" } ] } ]

Get List of Proxies Filtered by Destination Service (Deprecated)


Description:
Get the list of proxies filtered by destination service.
Since:3.2
Security:Requires an admin user
Usage:GET /api/v3/proxies?dest_service={destination_service_name}
Consumes:application/json
Sample Response:

[{“名称”:“proxy-01”,“url”:“http://609c68a0-9e8c-4104-adac-0623914c85bf", "sites" : [ { "source_site" : "source-site-name", "destination_site" : "destination-site-name" } ] } ]



Get List of Proxies Filtered by Source and Destination Service (Deprecated)

Description:Get the list of proxies by source service.
Since:3.2
Security:Requires an admin user
Usage:GET /api/v3/proxies?src_service={source_service_name}&dest_service={destination_service_name}
Consumes:application/json
Sample Response:

[{“名称”:“proxy-01”,“url”:“http://609c68a0-9e8c-4104-adac-0623914c85bf", "sites" : [ { "source_site" : "source-site-name", "destination_site" : "destination-site-name" } ] } ]



Get Proxy by Name (Deprecated)


Description:Get a proxy by name.
Since:3.2
Security:Requires an admin user
Usage:GET /api/v3/proxies/{name}
Consumes:application/json

Sample Response:

{ "name" : "proxy-01", "url" : "http://0277a02d-5267-46c9-a5c9-7836f0bff8fb", "sites" : [ { "source_site" : "source-Site", "destination_site" : "destination-Site" } ] }



Delete Proxy by Name (Deprecated)

Description:Removes a proxy from Mission Control.
Since:3.2
Security:Requires an admin user
Usage:DELETE /api/v3/proxies/{name}
Consumes:application/json


SITES (Deprecated)

当配置坐这些相关字段es:

Field Type Optional Description

name

String false Site's name
description String true Site's description
city Object false Site's city
city.name String true City's name
city.country_code String true City's country code
city.longitude Number false City's longitude
city.latitude Number false City's latitude
services Array true Names of services

Create Site (Deprecated)

Description:Create a new site.
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:POST /api/v3/sites

Return codes:

201 - No Content
400 -Couldn't find service(s) with following name(s):, '', ''

409 -Name '<Site name>' already exists.
Consumes:application/json

{ "name" : "", "description" : "", "city" : { "name" : "", "country_code" : "", "latitude" : , "longitude" :  }, "services" : [ "" ] }

Example:
In this example, a new Sunnyvale site is created and services "arti-west" and "xray-west" are associated with the new site. If the services exist,201 Createdwill be returned.

$ curl 'http://localhost:8080/api/v3/sites' -i -u 'admin:password' -X POST -H 'Content-Type: application/json; charset=UTF-8' -T createsite.json
createsite.json
{ "name": "us-west", "description": "US West coast site", "city": { "name": "Sunnyvale", "country_code": "US", "latitude": 37.368830, "longitude": -122.036350 }, "services": ["arti-west", "xray-west"] }


Update Site (Deprecated)

Description: Updates an exiting site by name.
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security: Requires an admin user
Usage: PUT /api/v3/sites/{name}

Return codes:

204 - No Content
409 - The entity 'Site' with identifier '' was not found
Consumes:application/json


{ "name" : "", "description" : "", "city" : { "name" : "", "country_code" : "", "latitude" : , "longitude" :  }, "services" : [ { "name" : "", "type" : "" }] }

Example:

In this example, an existing site named Argentina is being updated to Mexico Data Center with appropriate attributes. If the site 'Argentina' exists,204 No Contentwill be returned

$ curl -XPUT 'http://localhost:8080/api/v3/sites/Argentina' -i -u 'admin:password' -H 'Content-Type: application/json; charset=UTF-8' -T updatesite.json
updatesite.json
{ "name" : "Mexico Data Center", "description" : "Updated site description", "city" : { "name" : "Mexico City", "country_code" : "MX", "latitude" : 19.428470, "longitude" : -99.127660 } }



Partial Update Site By Name (Deprecated)

Description:Updates a sitewithout updating the attributes.
注:This API isdeprecatedfrom version 4.x.
Since:2.1
Security:Requires an admin user
Usage:PUT /api/v3/services/{name}

Return codes:

204 - No Content
Consumes:application/json

PATCH /api/v3/sites/{name}

Example:

PATCH /api/v3/sites/Site%20name HTTP/1.1 Content-Type: application/json; charset=UTF-8 Host: localhost:8080 Content-Length: 119 { "name" : "Updated site name", "description" : "Updated site description", "services" : [ "Artifactory name" ] } HTTP/1.1 204 No Content

Example:

$ curl 'http://localhost:8080/api/v3/sites/Site%20name' -i -u 'admin:password' -X PATCH -H 'Content-Type: application/json; charset=UTF-8' -d '{ "name" : "Updated site name", "description" : "Updated site description", "services" : [ "Artifactory name" ] }'



Get Site (Deprecated)

Description:Gets a site by name

注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:GET /api/v3/sites/{name}

Return codes:

200 - Success
409 - The entity 'Site' with identifier '{name}' was not found"
Produces:application/json

{ "name" : "", "description" : "", "city" : { "name" : "", "country_code" : "CODE", "latitude" : , "longitude" :  }, "services" : [ { "name" : "", "type" : "" }] }

Example:

In this example, information regarding Site named 'China' is being retrieved. If site 'China' exists200 Successwill be returned

$ curl -XGET 'http://localhost:8080/api/v3/sites/China' -uadmin:password
example output
{" name ":“北京”,“描述”:“北京的数据Center", "city": { "name": "Beijing", "country_code": "CN", "latitude": 39.907500, "longitude": 116.397230 }, "services": [ { "name": "arti-beijing", "type": "ARTIFACTORY" } ] } 200 Success



Get Site List (Deprecated)

Description:Gets a list of all sites
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:GET /api/v3/sites/

Return codes:

200 - Success
409 - The entity 'Site' with identifier '' was not found
Produces:application/json

[{ "name" : "", "description" : "", "city" : { "name" : "", "country_code" : "CODE", "latitude" : , "longitude" :  }, "services" : [ { "name" : "", "type" : "" }] }]

Example:

$ curl -XGET 'http://localhost:8080/api/v3/sites' -uadmin:password
example output
[ { "name": "China", "description": "", "city": { "name": "Shanghai", "country_code": "CN", "latitude": 31.22222, "longitude": 121.45806 }, "services": [ { "name": "China", "type": "ARTIFACTORY" } ] }, { "name": "Argentina", "description": "", "city": { "name": "Buenos Aires", "country_code": "AR", "latitude": -34.61315, "longitude": -58.37723 }, "services": [ { "name": "Source Local", "type": "ARTIFACTORY" } ] } ] 200 Success

Delete Site (Deprecated)


Description: Delete a site
注: This API is deprecated from version 4.x.
Since:2.0
Security:Requires an admin user
Usage:DELETE /api/v3/sites/{name}
Return codes:

200 - Success
409 -不能删除网站{名称},它有非空service(s): {name of the service}

Example:

$ curl -XDELETE 'http://localhost:8080/api/v3/sites/China' -uadmin:password -H "Content-Type: application/json"



SERVICES (Deprecated)

Create Service (Deprecated)

Description:Creates a new service.

注:This API isdeprecatedfrom version 4.x.
Since: 2.0. Updated in 3.2 with additional attributes
Security:Requires an admin user
Usage:POST /api/v3/services
Return codes:

201 - Created
409 -Failed to connect to the service. Please verify that the service information provided is correct
Consumes:application/json


{ "name" : "", "description" : "", "url" : "", "username" : "", "password" : "", "type" : "" "site_name" : ", "auth_token": "", "pair_with_auth_provider" : "", "auth_provider" : "" }


Example:

$ curl 'http://localhost:8080/api/v3/services' -i -u 'admin:password' -X POST -H 'Content-Type: application/json; charset=UTF-8' -T createservice.json
createservice.json
{ "name" : "dev-west", "description" : "Artifactory serving development in West region", "url" : "https://artifactory-west.acme.com/artifactory", "username" : "admin", "password" : "password", "type" : "ARTIFACTORY" } 201 Created

Update Service (Deprecated)


Description: Updates a service
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:PUT /api/v3/services/{name}
Return codes:

204 - No Content
409 - Url already exists
Consumes:application/json

{ "name" : "", "description" : "", "url" : "", "username" : "", "password" : "" }

Example:

$ curl 'http://localhost:8080/api/v3/services/dev-west' -i -u 'admin:password' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -T updateservice.json
updateservice.json
{ "name" : "dev-east", "description" : "Artifactory serving development in East region", "url" : "https://artifactory-east.acme.com/artifactory", "username" : "admin", "password" : "password" } 204 No Content


Get Service List (Deprecated)


Description:Get a list of all services
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:GET /api/v3/services/
Produces:application/json

Return codes:

200 - Success

Example:


$ curl -XGET 'http://localhost:8080/api/v3/services' -uadmin:password
example output
[ { "name": "Argentina", "description" : "Artifactory serving development in Argentina", "url": "http://10.0.0.8:8082/artifactory", "type": "ARTIFACTORY", "service_type": "jfrt", "service_id": "jfrt@01ccgfzxdyqd3y0d816fns0zhh", "site": { "city": { "country_code": "AR", "latitude": -34.61315, "longitude": -58.37723, "name": "Buenos Aires" }, "description": "", "name": "Argentina" } }, { "name": "China", "description" : "Artifactory serving development in China", "url": "http://10.0.0.8:8081/artifactory", "type": "ARTIFACTORY", "service_type": "jfrt", "service_id": "jfrt@01cdmdjarccxy009wnzmwf06jp", "site": { "city": { "country_code": "CN", "latitude": 31.22222, "longitude": 121.45806, "name": "Shanghai" }, "description": "", "name": "China" } } ]

Get List of Services with Proxy Based on Source (Deprecated)


Description: Gets the list of services managed by Mission Control with proxy
注: This API is deprecated from version 4.x.
Since: 3.2
Security:
Requires an admin user
Usage:
GET request to /api/v3/services?source=SourceConsumes: application/json

Example:
GET /api/v3/services?source=Source%20Artifactory%20Name HTTP/1.1 [ { "name" : "Source Artifactory Name", "url" : "http://Source Artifactory Name.com/artifactory", "type" : "ARTIFACTORY", "service_type" : "jfrt", "service_id" : "jfrt@01crqghgxara0b0ej8nct10dyd", "site" : { "name" : "Source Site Name", "description" : "59551ac7-d8a3-426d-90a7-730219f11ddc", "city" : { "name" : "73955951-ef5c-4864-a118-561b117fdb7c", "latitude" : 66.778899, "longitude" : 44.556644 } } }, { "name" : "Destination Artifactory Name", "url" : "http://Destination Artifactory Name.com/artifactory", "type" : "ARTIFACTORY", "service_type" : "jfrt", "service_id" : "jfrt@01crqghgxf30e91k6gascc1r7p", "site" : { "name" : "Destination Site Name", "description" : "06dce948-ef85-45d6-b600-c2dc8ca57a63", "city" : { "name" : "c64f2329-2021-49ec-9188-cea1840f9df6", "latitude" : 66.778899, "longitude" : 44.556644 } }, "proxy" : { "url" : "http://proxy.com" } } ]

Get Service by Name with Proxy based on Source (Deprecated)


Description:Get service by name managed by Mission Control with proxy.

注:This API isdeprecatedfrom version 4.x.
Since:
3.2
Security:
Requires an admin user
Usage:
GET /api/v3/services/{name}

Example:

GET /api/v3/services/jfrt%4001crqgh6fyxtpn1eyddfwa1hk1?source=Source%20Artifactory%20Name { "name" : "Destination Artifactory Name", "url" : "http://Destination Artifactory Name.com/artifactory", "type" : "ARTIFACTORY", "service_type" : "jfrt", "service_id" : "jfrt@01crqgh6fyxtpn1eyddfwa1hk1", "site" : { "name" : "Destination Site Name", "description" : "31c51fe9-dfa0-48d4-8ce7-675e2b6b1b43", "city" : { "name" : "28759984-cf1a-41bc-952c-33e4e3a7c4a0", "latitude" : 66.778899, "longitude" : 44.556644 } }, "proxy" : { "url" : "http://proxy.com" } }



Delete Service (Deprecated)

Description:Deletes a service
注:This API isdeprecatedfrom version 4.x.
Since:
2.0
Security:Requires an admin user
Usage:DELETE /api/v3/services/{name}
Return codes:

200 - Success

Example:

$ curl -XDELETE 'http://localhost:8080/api/v3/services/Argentina' -uadmin:password -H "Content-Type: application/json"

Get Repository List (Deprecated)


Description:Gets the list of repositories in the specified Artifactory service
注: This API is deprecated from version 4.x.
Since:
2.0
Security:Requires an admin user
Usage:GETapi/v3/services/artifactory/{name}/repositories
Return codes:

200 - Success

409 - Could not find Artifactory instance with name
Consumes: application/json

Example:

$ curl -XGET 'http://localhost:8080/api/v3/services/artifactory/{name}/repositories' -uadmin:password
example output
[ { "repository_key": "bower-local", "description": "", "type": "local", "package_type": "bower" }, { "repository_key": "generic-local", "description": "", "type": "local", "package_type": "generic" }, { "repository_key": "libs-release-local", "description": "", "type": "local", "package_type": "maven" }, ... { "repository_key": "npm", "description": "", "type": "virtual", "package_type": "npm" } ]



JPDs

Add JPD

Description:Adds a new JPD to Mission Control.

Since:4.0
Security:Requires an admin user
Usage:POST/mc/api/v1/jpd s

Return codes:

201 - Created
400 -Failed to connect to the JPD. Please verify that the JPD information provided is correct
409 - Conflicts with an existing JPD (URL, name)

Consumes:application/json


{ "name" : "", "url" : "", "token" : "", "location" : { "city_name" : "", "country_code" : "", "latitude" : , "longitude" :  }, "tags" : [ "", "" ] }


Example:

curl - x美元后'http://localhost:8082/mc/api/v1/jpds' -H 'Authorization: Bearer ' -H 'Content-Type: application/json; charset=UTF-8' -T create_JPD.json



create_JPD.json
{ "name" : "dev-west", "url" : "https://artifactory-west.acme.com", "token" : "", "location" : { "city_name" : "San Francisco", "country_code" : "US", "latitude" : 37.7749, "longitude" : 122.4194 }, "tags" : [ "prod", "dev" ] }


Update JPD

Description:Updates a JPD

Since:4.0
Security:Requires an admin user
Usage:PUT /mc/api/v1/jpds/{id}

Return codes:

204 - No Content
400 -Failed to connect to the JPD. Please verify that the JPD information provided is correct
409 - Conflicts with an existing JPD (URL, name)

Consumes:application/json


{ "name" : "", "url" : "", "token" : "", "location" : { "city_name" : "", "country_code" : "", "latitude" : , "longitude" :  }, "tags" : [ "", "" ] }


Example:

$ curl -X PUT 'http://localhost:8082/api/v1/jpds/JPD-3' -H 'Authorization: Bearer ' -H 'Content-Type: application/json; charset=UTF-8' -T update_JPD.json



update_JPD.json
{ "name" : "new_name", "url" : "http://new-jpd-url:8080/jpd.test", "location" : { "city_name" : "Toulouse", "country_code" : "FR", "latitude" : 43.6043, "longitude" : 1.4437 } }


Get JPD List

Description:Get a list of all JPDs, optionnaly filtering them according to tag, name, url or status. Those filters can contain the wildcard *.

Since:4.0
Security:Requires an admin user
Usage:GET /mc/api/v1/jpds[?name=&tag=&url=&status=
Produces:application/json
Return codes:
200 - Success

Example:

$ curl -X GET 'http://localhost:8082/mc/api/v1/jpds' -H 'Authorization: Bearer '



example output
[{" id ": " JPD-1”、“许可证”:[{“过期”:歧视e, "license_hash": "2c2ef96d8a90ea2bb91287258dc8ab72a6b0f749", "licensed_to": "www.si-fil.com", "type": "ENTERPRISE_PLUS_TRIAL", "valid_through": "2020-02-14" } ], "location": { "city_name": "Nuuk", "country_code": "GL", "latitude": 64.18347, "longitude": -51.72157 }, "name": "HOME", "services": [ { "status": { "code": "ONLINE" }, "type": "ARTIFACTORY" }, { "status": { "code": "ONLINE" }, "type": "JFMC" } ], "status": { "code": "ONLINE", "message": "All services are online", "warnings": [] }, "tags": [], "url": "http://jpd.local/" } ]

Get JPD by id


Description:Gets a JPD given its id
Since:4.0
Security:Requires an admin user
Usage:GET request to /mc/api/v1/jpds/
Consumes:application/json

Return codes:
200 - Success

Example:


$ curl -X GET 'http://localhost:8082/mc/api/v1/jpds/JPD-1' -H 'Authorization: Bearer '
{ "id": "JPD-1", "licenses": [ { "expired": false, "license_hash": "2c2ef96d8a90ea2bb91287258dc8ab72a6b0f749", "licensed_to": "www.si-fil.com", "type": "ENTERPRISE_PLUS_TRIAL", "valid_through": "2020-02-14" } ], "location": { "city_name": "Nuuk", "country_code": "GL", "latitude": 64.18347, "longitude": -51.72157 }, "name": "HOME", "services": [ { "status": { "code": "ONLINE" }, "type": "ARTIFACTORY" }, { "status": { "code": "ONLINE" }, "type": "JFMC" } ], "status": { "code": "ONLINE", "message": "All services are online", "warnings": [] }, "tags": [], "url": "http://jpd.local/" }



Delete JPD

Description:Removes a JPD from Mission Control

Since:4.0
Security:Requires an admin user
Usage:DELETE/mc/api/v1/jpds/{id}
Return codes:

200 - Success
204 - No content
404 - Not found

Example:

$ curl -X DELETE 'http://localhost:8082/mc/api/v1/jpds/JPD-321' -H 'Authorization: Bearer '




ACCESS FEDERATION

Get Access Federation Configuration for a Single JPD

Description:Gets the Access Federation configuration for a specific JPD. Returns the Federation targets configured for the provided JPD.

Since:4.0
Security:Requires an admin user
Usage:GET /mc/api/v1/federation/{JPD ID}
Return codes:

200 - Success
400 - The JPD is not a valid Access Federation candidate.
404 - The JPD was not found.
Consumes:application/json


Request Example:

$ curl -X GET 'http://localhost:8082/mc/api/v1/mc/api/v1/federation/JPD-1' -H 'Authorization: Bearer '

Response Example:

{ "entities" : [ "GROUPS", "USERS" ], "targets" : [ { "name" : "JFP-2", "code" : "access2JPDId", "url" : "http://localhost:37837/access" } ] }



Get Access Federation Configuration for All JPDs

Description:Gets the Access Federation configurations for all the JPDs.

Since:4.0
Security:Requires an admin user
Usage:GET /mc/api/v1/jpds/federation?includeNonConfiguredJPDs=false
Return codes:

200 - Success

Produces:application/json


Request Example:

$ curl -X GET 'http://localhost:8082/mc/api/v1/mc/api/v1/federation?include_non_configured=false' -H 'Authorization: Bearer '

Response Example:

[ { "source": "artifactory1", "entities": [ "GROUPS", "USERS" ], "targets": [ { "name": "JPD-2", "code": "access2JPDId", "url": "url2" } ] } ]



Configure Access Federation on a JPD

Description:Configures Access Federation for a specific JPD. As a pre-requisite, the source and targets must have been configured properly for Access Federation based onthis.
Since:4.0
Security:Requires an admin user
Usage:PUT /mc/api/v1/jpds/{JPD ID}/federation

Return codes:
200 - Success
400, 422 - Invalid input
404 - JPD not found or not an Artifactory


Example Request:

curl -X PUT 'http://localhost:8082/mc/api/v1/mc/api/v1/federation/JPD-12' -H 'Authorization: Bearer ' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "entities" : [ "USERS", "GROUPS" ], "targets" : [ { "name" : "artifactory2", "url" : "http://localhost:8080/access" } ] }'

Example Response:

[ { "label": "Get configuration of artifactory1", "status": "OK" }, { "label": "Get Access token from artifactory1", "status": "OK" }, { "label": "Check if artifactory2 trusts artifactory1", "status": "OK" }, { "label": "Send configuration to artifactory1", "status": "OK" }, { "label": "Add target artifactory2 to artifactory1", "status": "OK" } ]

Get Access Federation Candidates

Description:Gets the Access Federation candidates.
Since:4.0
Security:Requires an admin user
Usage:GET /mc/api/v1/federation/candidates

Return codes:
200 - Success

Request Example:

curl -X GET 'http://localhost:8082/mc/api/v1/mc/api/v1/federation/candidates' -H 'Authorization: Bearer '

Response Example:

["JPD-12", "JPD-13"]



Create Mesh

Description:Creates a mesh topology.As a pre-requisite, the source and targets must have been configured properly for Access Federation based onthis.

Since:4.0
Security:Requires an admin user
Usage:POST /mc/api/v1/federation/create_mesh
Return codes:

200 - Success
400, 422 - Invalid input
404 - JPD not found or not an Artifactory

Request Example:

curl -X POST 'http://localhost:8082/mc/api/v1/federation/create_mesh -H 'Authorization: Bearer ' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "jpds": [ "JPD-12", "JPD-13" ], "entities": [ "USERS", "GROUPS", "PERMISSIONS", "TOKENS" ] }'

Response Example:

[ { "label" : "SUCCESSFUL", "status" : "OK" } ]

MONITORING (Deprecated)

Get Services Status (Deprecated)

Description: Get status of all services
注:This API isdeprecatedfrom version 4.x.
Since: 2.0
Usage: GET /api/v3/services/monitoring/status
Return codes:

200 - Success

Produces: application/json

[ { "service_name": "", "up_time_in_sec": 

Example:

$ curl -XGET 'http://localhost:8080/api/v3/services/monitoring/status' -uadmin:password

Example output

[ { "service_name": "China", "up_time_in_sec": 29282, "service_state": "ONLINE" }, { "service_name": "Argentina", "up_time_in_sec": 131, "service_state": "ONLINE" } ]



Get Service Status (Deprecated)


Description: Get status of the specified service
注:This API isdeprecatedfrom version 4.x.
Since: 2.0
Usage: GET /api/v3/services/{name}/monitoring/status
Return codes:

200 - Success
409 - Could not find service with name
Produces: application/json

{ "service_name": "", "up_time_in_sec": 

Example:

$ curl -XGET 'http://localhost:8080/api/v3/services/China/monitoring/status' -uadmin:password

Example output

{ "service_name": "China", "up_time_in_sec": 46182, "service_state": "ONLINE" }


SUPPORT

Create Support Bundle

Description: Create a new support bundle.
Since:4.0
Security:Requires an admin user
Notes: All bundle items are optional.
Usage: POST /mc/api/v1/system/support/bundle

Return codes:
202 - Support bundle is being created and will be available soon
400 - Invalid option values
403 - Unauthorized

Sample Response:

{ "name" : "My support bundle", "description" : "Support bundle generated because of issue XYZ", "parameters" : { "configuration" : true, "system" : true, "logs" : { "include" : true, "start_date" : "2018-09-19", "end_date" : "2018-09-20" }, "thread_dump" : { "count" : 1, "interval" : 0 } } }

Example:

curl - x美元后-H 'Authorization: Bearer ' https://my-mission-control.jfrogdev.co/api/v1/system/support/bundle -H 'Content-Type: application/json' \ -d '{ "name": "JFMC support bundle", "description": "Support bundle generated because of issue with XYZ", "parameters": { "configuration": true, "system": true, "thread_dump": { "count": 1, "interval": 0 }, "logs": { "include": true, "start_date": "2018-12-25", "end_date": "2019-01-07" } } }'

Example Output:

HTTP/1.1 202 Accepted Content-Type: application/json Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 247 { "id" : "SUPP20180912154413548991", "artifactory" : { "service_id" : "jfrt@4754684682741", "bundle_url" : "http://artifactory.www.si-fil.com/artifactory/jfrog-support-bundle/SUPP20180912154413548991/jfmc/test_JPD } }

Get Support Bundles List

Description: Get the list of available support bundles.
Since:4.0
Security:Requires an admin user
Usage: GET /mc/api/v1/system/support/bundles

Return codes:
200 - Successful
403 - Unauthorized

Example:


GET /mc/api/v1/system/support/bundles HTTP/1.1

Sample Response:

{ "count" : 2, "bundles" : [ { "name" : "A", "description" : "aaa", "id" : "1", "created" : "2018-10-01T09:50:11Z" }, { "name" : "B", "id" : "2", "created" : "2018-10-01T09:50:11Z" } ] }



Get Details of a Support Bundle

Description:被一个特定的细节支持包。
Since:4.0
Security:Requires an admin user
Usage: GET /mc/api/v1/system/support/bundle/{id}

Return codes:
200 - Successful
403 - Unauthorized
404 - Supplied ID does not refer to an existing support bundle

Example:

GET /mc/api/v1/system/support/bundle/SUPP20180912154413548991 HTTP/1.1

Sample Response:


{ "name" : "issue #1234", "description" : "Support bundle created for issue #1234 investigation", "artifactory" : { "service_id" : "jfrt@4754684682741", "bundle_url" : "http://artifactory.www.si-fil.com/artifactory/jfrog-admin-supportbundle/SUPP20180912154413548991/jfmc/01c7b8rg70nrqr1cck7k4x0yp7" }, "parameters" : { "configuration" : true, "system" : true, "logs" : { "include" : true, "start_date" : "2018-09-30", "end_date" : "2018-10-01" }, "thread_dump" : { "count" : 1, "interval" : 0 } }, "available" : 5, "created" : "2018-10-01T09:50:10Z" }



Download Support Bundle

Description: Downloads a support bundle as a ZIP file.
Since:4.0
Security:Requires an admin user.You need to have the "Download folder" permission enabled on Artifactory.
Usage: GET /mc/api/v1/system/support/bundle/{id}/archive

Return codes:
200 - Successful
403 - Unauthorized (it may be that the "Download folder" option is not enabled on the Authentication Provider Artifactory)
404 - Supplied ID does not refer to an existing support bundle or the ZIP cannot be found in the Authentication Provider Artifactory repository

Example:

GET /mc/api/v1/system/support/bundle/SUPP20180912154413548991/archive HTTP/1.1



Delete Support Bundle

Description: Deletes a support bundle, along with the ZIP file in Artifactory.
Since:4.0
Security:Requires an admin user
Usage: DELETE /mc/api/v1/system/support/bundle/{id}

Return codes:
204 - Successful
403 - Unauthorized
404 - Supplied ID does not refer to an existing support bundle

Example:


DELETE /mc/api/v1/system/support/bundle/SUPP20180912154413548991 HTTP/1.1

Create Platform Support Bundle (DEPRECATED)

Description: Create a new support bundle.create support bundle for several JPDs
Since:4.0
Security:Requires an admin user
Usage: POST /mc/api/v1/platform/support/bundle

Return codes:

200 - Support bundle is being created and will be available soon
422 - JPD list empty or too large
504 - Timeout
400 - Invalid Request

Sample Response:

{ "name" : "my_support_bundle", "description" : "Platform Support Bundle test description", "services" : [ "self", "jfrt@64845741457245711" ], "parameters" : { "configuration" : true, "system" : true, "logs" : { "include" : true, "start_date" : "2019-03-14", "end_date" : "2019-03-15" }, "thread_dump" : { "count" : 1, "interval" : 0 } } }

Example Output:

example output
200 OK Content-Type: application/json Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 487 { "id" : "20190315-1624-cab48ff6-33e4-4e17-b2c9-845a71ffa3a7", "locations" : [ { "service_id" : "jfrt@01d612nxv8yfcn119xsj7d1jrz", "artifactory" : { "service_id" : "jfrt@other.www.si-fil.com", "bundle_url" : "http://other.www.si-fil.com/artifactory/" } }, { "service_id" : "jfmc@01c7b8rg70nrqr1cck7k4x0yp7", "artifactory" : { "service_id" : "jfrt@auth-provider.www.si-fil.com", "bundle_url" : "http://auth-provider.www.si-fil.com/artifactory/" } } ] }

Get Platform Support Bundles List (DEPRECATED)

Description: Gets a list of previously created support bundles.
Since:4.0
Security:Requires an admin user
Usage: GET /mc/api/v1/platform/support/bundles

Return codes:

200 - OK
400 - Invalid Request

Sample Usage:

GET /mc/api/v1/platform/support/bundles HTTP/1.1 Authorization: Basic YWRtaW46cGFzc3dvcmQ= Content-Type: application/json; charset=UTF-8 Host: localhost:8080

Example Output:

HTTP/1.1 200 OK Content-Type: application/json Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 319 { "bundles" : [ { "id" : "20190218-1554-c5043f76-4d6d-49e2-9ab7-2999b7af02ef", "name" : "sb-name", "description" : "sb-description", "created" : "2019-02-18T15:54:00Z" }, { "id" : "20190218-1553-bb12b2e0-3b16-44aa-889a-513c14976542", "created" : "2019-02-18T15:53:00Z" } ], "count" : 2 }



Get Platform Support Bundle Metadata (DEPRECATED)

Description: Gets the metadata for a previously created support bundle.
Since:3.5
Security:Requires an admin user
Usage: GET /mc/api/v1/system/support/bundle/{id}

Return codes:

200 - OK
400 - Invalid Request

Sample Usage:

GET /mc/api/v1/platform/support/bundle/20190218-1554-88722539-78af-41bc-a5d7-e7567fb7189f HTTP/1.1 Authorization: Bearer xxx Content-Type: application/json; charset=UTF-8 Host: localhost:8081

Example Output:

HTTP/1.1 200 OK Content-Type: application/json Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 742 { "id" : "20190218-1554-88722539-78af-41bc-a5d7-e7567fb7189f", "name" : "sb-name", "description" : "sb-description", "status" : "success", "created" : "2019-02-18T15:54:00Z", "parameters" : { "configuration" : true, "system" : true, "logs" : { "include" : true, "start_date" : "2019-03-14", "end_date" : "2019-03-15" }, "thread_dump" : { "count" : 1, "interval" : 0 } }, "locations" : [ { "service_id" : "jfxr@2222", "artifactory" : { "service_id" : "jfrt@jfxr", "bundle_url" : "https://art.jfxr" } }, { "service_id" : "jfds@1111", "artifactory" : { "service_id" : "jfrt@jfds", "bundle_url" : "https://arti.jfds" } } ] }

Get Platform Support Bundle(DEPRECATED)

Description: Downloads a previously created support bundle as a ZIP file.

Since:4.0
Security:Requires an admin user
Usage: GET /mc/api/v1/platform/support/bundle/{id}/archive

Return codes:

200 - Support bundle zip will be downloaded
400 - Invalid Request

Sample Usage:

GET /mc/api/v1/platform/support/bundle/20190218-1553-2ea5aa8c-0ee7-4981-9028-d19c653b423a/archive HTTP/1.1 Authorization: Basic YWRtaW46cGFzc3dvcmQ= Content-Type: application/json; charset=UTF-8 Host: localhost:8081

Example Output:

HTTP/1.1 200 OK Content-Disposition: attachment; filename="20190218-1553-2ea5aa8c-0ee7-4981-9028-d19c653b423a.zip" Content-Type: application/zip Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 28

Delete Platform Support Bundle(DEPRECATED)

Description: Deletes a previously created support bundle, along with the ZIP file in Artifactory.
Since:4.0
Security:Requires an admin user
Usage: DELETE /mc/api/v1/platform/support/bundle/{id}

Return codes:

200 - Support bundle successfully deleted
404 - Support bundle id not found or invalid
500 - Support could not be deleted

Sample Usage:

DELETE /mc/api/v1/platform/support/bundle/20190218-1554-7d3f4afa-a129-435e-822a-d19a052f9b4a HTTP/1.1 Authorization: Basic YWRtaW46cGFzc3dvcmQ= Content-Type: application/json; charset=UTF-8 Host: localhost:8081

Example Output:

HTTP/1.1 200 OK Content-Type: application/json Server: mission-control/SNAPSHOT Strict-Transport-Security: max-age=31536000; includeSubDomains Content-Length: 110 { "deleted" : [ "jfmc@01c7b8rg70nrqr1cck7k4x0yp7", "jfrt@01d612qkz4bjqt0e36d13s1ry5" ], "failures" : [ ] }

DISASTER RECOVERY (Deprecated)

Create DR Pair (Deprecated)


Description : Matches up a Master and Target Artifactory service as a DR pair.
注: This API is deprecated from version 4.x.
Since:
2.0
Security: Requires an admin user
Usage: POST /api/v3/dr-configs
Consumes: application/json
{“源”:“< >源artifactory实例”,“焦油get" : "" }

Produces:application/json

{ "active": "NONE", "dr_replications_enabled": , "state": "NONE" }

Example:

curl - x美元后'http://localhost:8080/api/v3/dr-configs' -i -u 'admin:password' -H 'Content-Type: application/json; charset=UTF-8' -T createdr.json
createdr.json
{ "source" : "Mexico", "target" : "China" }


Example return:

Example return
{ "active": "NONE", "dr_replications_enabled": false, "state": "NONE" }



SCRIPTS (Deprecated)

Get Scripts (Deprecated)

Description:Get a list of all scripts
注:This API isdeprecatedfrom version 4.x.
Since:2.0
Security:Requires an admin user
Usage:GET/api/v3/scripts

Return codes:

200 - Success

Produces:application/json

Sample Response:

[ { "name" : "