Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section explains the following REST operations regarding the collection which have has been secured with OAuth 2.0.

  • Get the content of a collection.
  • Add a collection
  • Delete a given collection

...

Table of Contents

Note

The following terms explain the meaning of the parameters passed with the below REST URIs

ParameterExplanation
Collection pathPath of the resource
OAuth access tokenAuthorized access token per user for an hour by default

When a user adds a collection to the registry, the user has to specify the Media-Type of the collection in the request (as a Header). The Media-Type for the collection is "application/atomcoll+xml". If the user specifies a different content-type for the collection, the resource  to be added won't be considered as a collection.

Get the Content of a Collection

JSON
AttributesValues
HTTP MethodGET
Request URI http://<ip address>:<port>/restapi/resource/<collection path>/artifact{ collection path }
HTTP Request HeaderAuthorization: Bearer <OAuth access token>Response                      Content { OAuth access token }
ResponseHTTP 200 OK
Response typeapplication/json
Description                 Retrieves the content the paths of the requested collectionResponse Type

Add a

...

Collection

/collection - if Success/ 401 - if fails
Attributesvalues
HTTP MethodPUT
Request URIhttp://<ip address>:<port>/restapi/resource/<complete /artifact{ complete path of the collection to be added>added }
HTTP Request Header

Authorization: Bearer

<OAuth

{ OAuth access

token>

token }

Request

Content-Type: application/atomcoll+xml

Sample requestcurl -v -k -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/atomcoll+xml" -d "https://localhost:9443/resource/1.0.0/artifact/_system/governance/permission/applications/TestSP/TestCol"
ResponseHTTP 204 No Content
Response typeapplication/json
DescriptionIt adds the specified collection if doesn't exist.

Delete a

...

Collection

...

- if success/ 401 - if fails.
Attributesvalues
HTTP MethodDELETE
Request URI http://<ip address>:<port>/restapi/resource/<collection path>/artifact{ collection path }
HTTP Request HeaderAuthorization: Bearer <OAuth { OAuth access token>token }
ResponseHTTP 204 No Content
Note

Please note the following points for the above requests.

  • ip address -IP address at which Governance Registry is running
  • port - HTTP port number at the Governance Registry is up
  • collection path - Path of the collection
  • OAuth access token - Authorized access token per user for an hour by default.
  • restapi - name of the War file for the REST API resides at {Greg_home}/repository/deployment/server/jaxwebapps. If the user renamed this war file,
                     the new name will be used instead of restapi.

 

 

 

Response typeapplication/json
DescriptionIt deletes the requested collection if it exists.