Update Service State

patch

/appstore/publisher/v1/services/{listingVersionId}

This method can be used to perform a partial update operation on service attributes or perform a state change operation in the service life-cycle. In order to perform a partial update, provide any root-level attribute in the payload. The content of that specified attribute will be completely replaced, while keeping the values of the other attributes same as before. Unlike PUT method, where the API expects the mandatory attributes to be present in the payload, this operation poses no such restriction. A state change operation, on the other hand, can be performed by a special attribute called "action" and another optional attribute called "note" in the payload. If the attribute "action" is present in the payload, the API assumes that it is a state change operation. Action supports the following values: - Submit : Submits a service for review. This moves the service to a PENDING_REVIEW state for an Administrator to review. - Publish: Publishes a service to the Marketplace. This makes the service available on the public Marketplace. The service status is changed to "PUBLISHED". Only an approved service can be published. - Withdraw : Withdraws an service from the Marketplace. This can be called only on a published service. - Edit: Moves a submitted service (in either of the states "PENDING_REVIEW", "REVIEWING" or "APPROVED") to "NEW" state. If the service was already approved, it would need to be re-submitted for approval.

Request

Supported Media Types
Path Parameters
Body ()
Required only for submit, action, and notes. For publish, withdraw just the "action" field is sufficient.
Root Schema : AppStatus
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successful Operation
Body ()
Root Schema : acknowledgement
Type: object
Show Source

400 Response

Bad Request/Invalid Parameter

401 Response

Not Authorized

500 Response

System Error
Back to Top

Examples

1. Submit a service

The following example submits a partner's unpublished service for Oracle approval, by submitting a PATCH request on the REST resource using cURL. A submission note can be provided when the submit action is chosen.

cURL Example

curl -X PATCH -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "Content-Type: application/json" -d 'JSON-data-as-shown-in-following-example' "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/services/9483951"

Request Header

X-Oracle-UserId: fname.lname@oracle.com
Authorization: Bearer Access-token
Content-Type: application/json

Request Body

{
  "action": "submit",
  "note": "any submission notes for admin"
}

HTTP Status Code:

200 OK

JSON Response:

{
  "message": "submit operation successful on listing.",
  "entityId": "9483951"
}

2. Publish a service

The following example publishes a service by a partner after it has been approved by Oracle admin, by submitting a PATCH request on the REST resource using cURL.

cURL Example

curl -X PATCH -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "Content-Type: application/json" -d 'JSON-data-as-shown-in-following-example' "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/services/9483951"

Request Header

X-Oracle-UserId: fname.lname@oracle.com
Authorization: Bearer Access-token
Content-Type: application/json

Request Body

{
  "action": "publish",
  "note": "any submission notes for admin"
}

HTTP Status Code:

200 OK

JSON Response:

{
  "message": "publish operation successful on listing. Earlier version, if any, would be withdrawn.",
  "entityId": "9483951"
}

3. Withdraw Service

The following example withdraws a service published by a partner from the marketplace, by submitting a PATCH request on the REST resource using cURL.

cURL Example

curl -X PATCH -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "Content-Type: application/json" -d "JSON-data-as-shown-in-following-example" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/services/9483951"

Request Header

X-Oracle-UserId: fname.lname@oracle.com
Authorization: Bearer Access-token
Content-Type: application/json

Request Body

{
  "action": "withdraw"
}

HTTP Status Code:

200 OK

JSON Response:

{
  "message": "withdraw operation successful on listing.",
  "entityId": "9483951"
}
Back to Top