Cookbook for Publishing OCI Resource Manager Listings

Publish OCI Terraform listings to the Marketplace using publisher APIs.

Marketplace partners can publish OCI Terraform listings to the Marketplace using either the Marketplace Partner Portal (UI app) or the Publisher REST APIs. This document describes the process using Publisher APIs. See Marketplace Publisher APIs.

Publisher API Cookbook

This section lists the API samples for publishing a listing with one or more package versions to the Marketplace.

Publisher API Credentials

For Publisher API credentials, contact Oracle support.

Replace the {endpoint-url} in the following sections with the following Endpoint URL for your target environment.

Environment Publisher API Endpoint URL
Production https://ocm-apis-cloud.oracle.com/appstore/publisher

Replace {user_id} with the partner user email id in the following steps.

Oauth Token Generation

Request:
curl -X GET \
{endpoint-url}/appstore/publisher/v1/authenticate \
-H 'authorization: Basic Y2IxZjJkZjUtY2U3Yi00YWNjLWIxZDgtOThiZDIyZDY5NGZlOnN3aFZBakNSVUdLVHRjUE5lcWww' \
-H 'cache-control: no-cache'
Response:
{
"oracle_client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
"expires_in": 604800,
"oracle_tk_context": "client_assertion",
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsIng1dCI6Im9KWTEtVHhTTW5HZUFiYlZzdGhPY3U1cW5QayIsImtpZCI6Im9jbWNvbXB1dGUuY2VydCJ9.eyJzdWIiOiJjYjFmMmRmNS1jZTdiLTRhY2MtYjFkOC05OGJkMjJkNjk0ZmUiLCJpc3MiOiJvY21jb21wdXRlIiwib3JhY2xlLm9hdXRoLnN2Y19wX24iOiJvY21jb21wdXRlU2VydmljZVByb2ZpbGUiLCJpYXQiOjE1MzkwMDEzODYsIm9yYWNsZS5vYXV0aC5wcm4uaWRfdHlwZSI6IkNsaWVudElEIiwiZXhwIjoxNTM5NjA2MTg2LCJvcmFjbGUub2F1dGgudGtfY29udGV4dCI6ImNsaWVudF9hc3NlcnRpb24iLCJhdWQiOlsiaHR0cHM6Ly9ybm8yMTQwMDUudXMub3JhY2xlLmNvbS9hcHBzdG9yZS9tYXJrZXRwbGFjZSIsImh0dHBzOi8vcm5vMjE0MDA1LnVzLm9yYWNsZS5jb20vYXBwc3RvcmUvcHVibGlzaGVyIl0sInBybiI6ImNiMWYyZGY1LWNlN2ItNGFjYy1iMWQ4LTk4YmQyMmQ2OTRmZSIsIm9yYWNsZS5vYXV0aC5zdWIuaWRfdHlwZSI6IkNsaWVudElEIiwianRpIjoiMzhiNTVmNzctMDJmZS00MWM4LWJkODQtNjljYjFhMmE4NTU1IiwidXNlci50ZW5hbnQubmFtZSI6Im9jbWNvbXB1dGUiLCJvcmFjbGUub2F1dGguaWRfZF9pZCI6IjQxNzk0ODIxNjYwMDk4MTgzIn0.BmE2MUlkIzMOwK4skM1dzjJf3ebLODXv_tecWGYwcq5Y79KvG8_ouxGsfmlL1KvZsNAiXXlb9IUT4d5spEHroACmj_vV49ox9w-NjQXn_SKcNkvQ8wfVd12pEcerFEcqjt-MPw7rm0U4FLbGQXLJ0GlF50d0ccPYCx23Q5SBY4wvlpHYvwbaQTUAjQj6KODDFWnTe8Tldp_Vl3mGsplSn7hw6xhaERX5v0xikhj7R46bkRIcqblpVIawMo2nhc9Gy0g6GneCmUOXDGLbJjE6t2udBWwQviaHZrgiY2di1fwGR9kuDo9vGUJAYFjSMJU1sVIiSn4l9tksDuzplz8FUw",
4 WHITE PAPER / Cookbook to Publish OCI Resource Manager Listings
"token_type": "Bearer"
}
To generate authorization header,
  1. Form the concatenated string from Client Id, Secret as "<ClientID>:<Secret>" For example, if Client Id is "cb1f2df5-ce7b-4acc-b1d8-98bd22d694fe" and Secret is "swhVAjCRUGKTtcPNeql0", then form the string as "cb1f2df5-ce7b-4acc-b1d8-98bd22d694fe:swhVAjCRUGKTtcPNeql0".

  2. Base64 encode the concatenated string, for example the above string after Base64 encoding is: "Y2IxZjJkZjUtY2U3Yi00YWNjLWIxZDgtOThiZDIyZDY5NGZlOnN3aFZBakNSVUdLVHRjUE5lcWww"

  3. Use this Base64 encoded value as 'authorization' header to get the access_token.

Usage of access_token:

A successful call to /authenticate you will find "access_token" property in response. You have to use this property's value as "authorization" header value in the API calls listed below. To construct the "authorization" header value, form the string as "Bearer <access_token_header_value>".

For example, this value is formed using the access_token received in the above response.

"Bearer
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsIng1dCI6Im9KWTEtVHhTTW5HZUFiYlZzdGhPY3U1cW5QayIsImtpZCI6Im9jbWNvbXB1dGUuY2VydCJ9.eyJzdWIiOiJjYjFmMmRmNS1jZTdiLTRhY2MtYjFkOC05OGJkMjJkNjk0ZmUiLCJpc3MiOiJvY21jb21wdXRlIiwib3JhY2xlLm9hdXRoLnN2Y19wX24iOiJvY21jb21wdXRlU2VydmljZVByb2ZpbGUiLCJpYXQiOjE1MzkwMDEzODYsIm9yYWNsZS5vYXV0aC5wcm4uaWRfdHlwZSI6IkNsaWVudElEIiwiZXhwIjoxNTM5NjA2MTg2LCJvcmFjbGUub2F1dGgudGtfY29udGV4dCI6ImNsaWVudF9hc3NlcnRpb24iLCJhdWQiOlsiaHR0cHM6Ly9ybm8yMTQwMDUudXMub3JhY2xlLmNvbS9hcHBzdG9yZS9tYXJrZXRwbGFjZSIsImh0dHBzOi8vcm5vMjE0MDA1LnVzLm9yYWNsZS5jb20vYXBwc3RvcmUvcHVibGlzaGVyIl0sInBybiI6ImNiMWYyZGY1LWNlN2ItNGFjYy1iMWQ4LTk4YmQyMmQ2OTRmZSIsIm9yYWNsZS5vYXV0aC5zdWIuaWRfdHlwZSI6IkNsaWVudElEIiwianRpIjoiMzhiNTVmNzctMDJmZS00MWM4LWJkODQtNjljYjFhMmE4NTU1IiwidXNlci50ZW5hbnQubmFtZSI6Im9jbWNvbXB1dGUiLCJvcmFjbGUub2F1dGguaWRfZF9pZCI6IjQxNzk0ODIxNjYwMDk4MTgzIn0.BmE2MUlkIzMOwK4skM1dzjJf3ebLODXv_tecWGYwcq5Y79KvG8_ouxGsfmlL1KvZsNAiXXlb9IUT4d5spEHroACmj_vV49ox9w-NjQXn_SKcNkvQ8wfVd12pEcerFEcqjt-MPw7rm0U4FLbGQXLJ0GlF50d0ccPYCx23Q5SBY4wvlpHYvwbaQTUAjQj6KODDFWnTe8Tldp_Vl3mGsplSn7hw6xhaERX5v0xikhj7R46bkRIcqblpVIawMo2nhc9Gy0g6GneCmUOXDGLbJjE6t2udBWwQviaHZrgiY2di1fwGR9kuDo9vGUJAYFjSMJU1sVIiSn4l9tksDuzplz8FUw"

Add Icon to an Application

Request:
curl -X POST \
{endpoint_url}/appstore/publisher/v1/applications/16034919/icon \
-H 'Authorization: Bearer {{access_token}}' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'image=@content.png'
Response:
{
"message": "Icon upload was successful",
"entityId": "16034935"
}

Create a New Version of the Application Listing

Request:
curl -X POST \
{endpoint_url}/appstore/publisher/v1/applications/16034919/version \
-H 'Authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}'
Response:
{
"message": "A new version was created.",
"entityId": "16034994"
}

Create a Package Version From Existing Package

Note

OCI package operations available with Publisher Application version V2.

In URL: /appstore/publisher/v2/applications/16034994/packages/16034937/version

Here, 16034994 is the listingVersionId and 16034937 is packageId of the newly versioned package.

Request:
curl -X PATCH \
{endpoint_url}/appstore/publisher/v2/applications/16034994/packages/16034937/version \
-H 'Authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}'
Response:
{
"message": "Listing Template created with Template Id 16035011 for Listing Version Id 16034994",
"entityId": "16035011"
}

Create a Terraform Artifact

Before you begin, ensure that the file "Terraform.zip" exists in the directory.
Request:
curl -X POST \
{endpoint_url}/appstore/publisher/v1/artifacts \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{access_token}}' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'json={ "name": "APSREST_AF_02132019", "artifactType": "TERRAFORM_TEMPLATE" }' \
-F 'file=@Terraform.zip' \
5 WHITE PAPER / Cookbook to Publish OCI Resource Manager Listings
-F accept=application/json
Response:
{
"message": "OK",
"entityId": "15990161"
}

Create Application Listing

Request:
curl -X POST \
{endpoint_url}/appstore/publisher/v1/applications/ \
-H 'Authorization: Bearer {{access_token}}' \
-H 'Content-Type: application/json' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-d '{
"name":"Jenkins",
"products": [
{
"code": "oci",
"categories": [
{
"code": "APPLICATION_STACKS"
}
]
}
],
"deviceType":{
"code":"BROWSER"
},
"pricing":{
"type":"FREE",
"description":""
},
"listingContentLanguage":{
"code":"en_US"
},
"shortDescription": "Short description",
"longDescription": "Long description",
"usageInformation": "Usage Information",
"tags": "Jenkins",
"tagLine": "Continuous Integration and Continuous Delivery",
"listingContentLanguage": {
"code": "en_US",
"name": "English"
},
"versionDetails":{
"versionNumber": "4.0.0-0 on OL 7.5",
"releaseDate": "2018-07-10T00:00:00.000Z"
},
"systemRequirements":"System Requirements",
"support":{
"contacts":null,
"links": [
{
"name": "Support Page",
"url": "https://example.com/support/oci"
}, {
"name": "Community",
"url": "https://community.example.com/"
}
]
},
"availableInAllRegions":true,
"languages":[
{
"code":"en_US"
}
]
}'
Response:
{
"message": "Listing was created successfully.",
"entityId": "16034919",
"name": "Jenkins"
}

Create Listing Package

Note

OCI package operations available with Publisher application version V2.
Request:
curl -X POST \
{endpoint_url}/appstore/publisher/v2/applications/16034919/packages \
-H 'Authorization: Bearer {{access_token}}' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'json={
"version":"1.0.1",
"description":"Jenkins",
"serviceType": "OCIOrchestration",
"resources": [{
"serviceType": "OCIOrchestration",
"type": "terraform",
"properties": [{
"name": "artifact",
"value": "15990161",
"valueProperties": [{
"name": "name",
"value": "APSREST_AF_02132019"
}]
},
{
"name": "compartmentId",
"source": "end_user",
"displayName": "Compartment ID",
"dataType": "string",
"mandatory": true,
"custom": false,
"cardinality": "SINGLE_VALUE"
}
]
}]
}'
Response:
{
"message": "Listing Template created with Template Id 16034937 for Listing Version Id 16034919",
"entityId": "16034937"
}

Get all Artifacts

Request:
curl -X GET \
{endpoint-url}/appstore/publisher/v1/artifacts?artifactType=TERRAFORM_TEMPLATE \
-H 'Authorization: Bearer {{access_token}}' \
-H 'Content-Type: application/json' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache'
Response:
{
"items": [
{
"Artifact": {
"artifactId": 16034835,
"artifactType": "Terraform Template",
"name": "APSREST_AF_02132019",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-02-13T00:40:58.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2019-02-13T00:40:55.000Z"
}
},
{
"Artifact": {
"artifactId": 16028295,
"artifactType": "Terraform Template",
"name": "APS1941 AF_feb9",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-02-11T10:28:16.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2019-02-11T10:28:13.000Z"
}
},
{
"Artifact": {
"artifactId": 15997307,
"artifactType": "Terraform Template",
"name": "testing",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-01-23T07:30:54.000Z",
"createdBy": "Jone Hail",
"creationDate": "2019-01-23T07:30:50.000Z"
}
},
{
"Artifact": {
"artifactId": 15997300,
"artifactType": "Terraform Template",
"name": "APS1942 AF_0121194",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-01-23T06:57:22.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2019-01-23T06:56:57.000Z"
}
},
{
"Artifact": {
"artifactId": 15995924,
"artifactType": "Terraform Template",
"name": "aps19.1.4",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-01-21T15:05:08.000Z",
"createdBy": "John Doe",
"creationDate": "2019-01-21T15:05:06.000Z"
}
},
{
"Artifact": {
"artifactId": 15995917,
"artifactType": "Terraform Template",
"name": "APS1846 AF_0121194",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-01-21T15:03:05.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2019-01-21T15:03:01.000Z"
}
},
{
"Artifact": {
"artifactId": 15990161,
"artifactType": "Terraform Template",
"name": "testerewrewr",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2019-01-18T10:07:01.000Z",
"createdBy": "John Doe",
"creationDate": "2019-01-18T10:07:00.000Z"
}
},
{
"Artifact": {
"artifactId": 15917942,
"artifactType": "Terraform Template",
"name": "fort",
"status": "Available",
"processingStatusNote": "The artifact has been successfully created",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-12-17T07:38:47.000Z",
"createdBy": "Jone Hail",
"creationDate": "2018-12-17T07:38:23.000Z"
}
},
{
"Artifact": {
"artifactId": 15904854,
"artifactType": "Terraform Template",
"name": "test",
"status": "Available",
"processingStatusNote": "The artifact has been successfully created",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-12-12T13:04:21.000Z",
"createdBy": "John Doe",
"creationDate": "2018-12-12T13:04:18.000Z"
}
},
{
"Artifact": {
"artifactId": 15897854,
"artifactType": "Terraform Template",
"name": "t1_test",
"status": "Unavailable",
"processingStatusNote": "Artifact creation failed",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-12-10T06:37:47.000Z",
"createdBy": "John Doe",
"creationDate": "2018-12-10T06:37:05.000Z"
}
},
{
"Artifact": {
"artifactId": 15849717,
"artifactType": "Terraform Template",
"name": "TFArtifact_110118-1051",
"status": "Available",
"processingStatusNote": "The artifact has been successfully created",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-11-01T05:22:11.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2018-11-01T05:21:45.000Z"
}
},
{
"Artifact": {
"artifactId": 15848729,
"artifactType": "Terraform Template",
"name": "TFArtifact_110118",
"status": "Available",
"processingStatusNote": "The artifact has been successfully created",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-11-01T04:44:47.000Z",
"createdBy": "Jane Wilson",
"creationDate": "2018-11-01T04:44:19.000Z"
}
}
],
"hasMore": false,
"count": 12,
"totalResults": 12,
"links": [
{
"rel": "CANONICAL",
"href": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v1/artifacts"
},
{
"rel": "SELF",
"href": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v1/artifacts?artifactType=TERRAFORM_TEMPLATE"
}
]
}

Get Application Listing Details

Request:
curl -X GET \
{endpoint_url}/appstore/publisher/v1/applications/16034919 \
-H 'Authorization: Bearer {{access_token}}' \
-H 'Content-Type: application/json' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache'
Response:
{
"name": "Jenkins",
"listingId": 16034918,
"listingVersionId": 16034919,
"products": [
{
"code": "oci",
"name": "Oracle Cloud Infrastructure",
"categories": [
{
"code": "APPLICATION_STACKS",
"name": "Project Management"
}
]
}
],
"deviceType": {
"code": "BROWSER",
"name": "Browser"
},
"pricing": {
"type": "FREE",
"name": "Free",
"description": null
},
"isPrivate": false,
"shortDescription": "Short description",
"longDescription": "Long description",
"usageInformation": "Usage Information",
"tags": "Jenkins",
"tagLine": "Continuous Integration and Continuous Delivery",
"listingContentLanguage": {
"code": "en_US",
"name": "English"
},
"versionDetails": {
"versionNumber": "4.0.0-0 on OL 7.5",
"releaseDate": "2018-07-10T00:00:00.000Z"
},
"systemRequirements": "System Requirements",
"hasTemplate": true,
"languages": [
{
"code": "en_US",
"name": "English"
}
],
"status": "APPROVED",
"support": {
"contacts": null,
"links": [
{
"name": "Support Page",
"url": "https://example.com/support/oci"
},
{
"name": "Community",
"url": "https://community.example.com/"
}
]
},
"icon": {
"name": "content.png",
"contentURL": "https://ocm-apis-cloud.oracle.com/partner/content?contentId=16034935",
"resourceURL": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v1/applications/16034919/icon/16034935",
"mimeType": "image/png",
"fileExtension": "png"
},
"availableInAllRegions": true,
"regions": [],
"packageAvailable": true,
"versionedListing": false,
"lastUpdateDate": "2019-02-13T04:40:39.003Z",
"partnerId": 7972187,
"links": [
{
"rel": "CANONICAL",
"href": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v1/applications/16034919"
}
]
}

Get Artifact by ID

Request:
curl -X GET \
{endpoint-url}/appstore/publisher/v1/artifacts/15990161 \
-H 'accept: application/json' \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}'
Response:
{
"artifactId": 15990161,
"artifactType": "Terraform Template",
"name": "APSREST_AF_02132019",
"status": "Available",
"processingStatusNote": "The artifact has been successfully created",
"lastModifiedBy": "Solis Doe",
"lastModifiedDate": "2018-12-12T13:04:21.000Z",
"createdBy": "John Doe",
"creationDate": "2018-12-12T13:04:18.000Z",
"uploadRequest": {
"artifactUploadRequestId": 15904856,
"numberOfMultiparts": 1,
"status": "Completed",
"fileName": "Terraform.zip",
"uploadParts": [
{
"partNumber": 1,
"partFileName": "Terraform.zip",
"sizeInBytes": 191133
}
]
}
}

Get the Package Version ID

Note

OCI package operations available with Publisher Application version V2.
Request:
curl -X GET \
{endpoint-url}/appstore/publisher/v2/applications/16034994/packages \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}'
Response:
{
"items": [
{
"Package": {
"id": 16034937,
"serviceType": "OCIOrchestration",
"description": "Jenkins",
"version": "1.0.1",
"status": {
"code": "published",
"displayName": "Published"
},
"referredByOtherListings": true,
"resources": [
{
"id": 16034938,
"type": "terraform",
"serviceType": "OCIOrchestration",
"properties": [
{
"name": "artifact",
"source": "publisher",
"value": "15990161",
"displayName": "Artifact",
"dataType": "artifact",
"mandatory": true,
"custom": false,
"supportedFiles": "TERRAFORM_TEMPLATE",
"cardinality": "SINGLE_VALUE",
"valueProperties": [
{
"name": "name",
"value": "APSREST_AF_02132019"
},
{
"name": "CreationDate",
"value": "Sep 17, 2018 02:41 AM"
}
]
},
{
"name": "displayName",
"source": "publisher",
"value": "terraform-oci-jenkins",
"displayName": "Display Name",
"dataType": "string",
"mandatory": false,
"custom": false,
"cardinality": "SINGLE_VALUE"
}
]
}
],
"default": true
}
}
],
"hasMore": false,
"count": 1,
"totalResults": 1,
"links": [
{
"rel": "CANONICAL",
"href": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v2/applications/16034919/packages"
},
{
"rel": "SELF",
"href": "https://ocm-apis-cloud.oracle.com/appstore/publisher/v2/applications/16034919/packages"
}
]
}

Publish an Application Listing

Request:
curl -X PATCH \
{endpoint_url}/appstore/publisher/v1/applications/16034919 \
-H 'Authorization: Bearer {{access_token}}' \
-H 'Content-Type: application/json' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-d '{"action":"publish"}'
Response:
{
"message": "publish operation successful on listing. Earlier version, if any, would be withdrawn.",
"entityId": "16034919"
}

Republish the Unpublished Package

Note

OCI package operations available with Publisher Application version V2.
Request:
curl -X PATCH \
{endpoint-url}/appstore/publisher/v2/applications/16034994/packages/16034937 \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}' \
-d '{"action":"publish"}'
Response:
{
"message": "Request for unpublish has been removed successfully.",
"entityId": "16034994"
}
Note

On environments that don't have legitimate certificates, add -k to turn off curls verification of certificates.

Set a Package Version as Default-Mark as Default

Note

OCI package operations available with Publisher application version V2.
Request:
curl -X PATCH \
{endpoint-url}/appstore/publisher/v2/applications/16034994/packages/16035011 \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}' \
-d '{"action":"default"}'
Response:
{
"message": "ListingPackage default was successful.",
"entityId": "16034994"
}

Submit an Application Listing for Approval

Note

Here, the Enable this partner to approve a new listing without requiring Oracle approval" option is enabled for this partner.
Request:
curl -X PATCH \
{endpoint_url}/appstore/publisher/v1/applications/16034919 \
-H 'Authorization: Bearer {{access_token}}' \
-H 'Content-Type: application/json' \
-H 'X-Oracle-UserId: {user_id}' \
-H 'cache-control: no-cache' \
-d '{"action":"submit",
"note":"Submitting the Appllication"}'
Response:
{
"message": "submit operation successful on listing.",
"entityId": "16034919"
}

Unpublish Existing Package

Note

  • OCI package operations available with Publisher application version V2.
  • We can't unpublish the default package.

  • We can't unpublish when only one package exists for a listing.

Request:
curl -X PATCH \
{endpoint-url}/appstore/publisher/v2/applications/16034994/packages/16034937 \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}' \
-d '{"action":"unpublish"}'
Response:
{
"message": "Request for unpublish has been created successfully. The package will be unpublished when the listing is published.",
"entityId": "16034994"
}

Update Versioned Listing Details–Update Field Description

curl -X PATCH \
{endpoint-url}/appstore/publisher/v1/applications/16034994 \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'x-oracle-userid: {user_id}'\
-d '{
"longDescription": "Modified Listing long description",
"shortDescription": "Modified Listing short description "
}'
Response:
{
"message": "Listing was updated successfully.",
"entityId": "16034998",
"name": "Jenkins"
}

Update Versioned Package Details-Associate Newly Created Artifact

Note

OCI package operations available with Publisher application version V2.
Request:
curl -X PUT \
{endpoint-url}/appstore/publisher/v2/applications/16034994/packages/16035011 \
-H 'authorization: Bearer {{access_token}}' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'x-oracle-userid: {user_id}' \
-F 'json={
"resources":[
{
"serviceType":"OCIOrchestration",
"type":"terraform",
"properties":[
{
"name":"artifact",
"value":"15849717",
"valueProperties":[
{
"name":"name",
"value":"TFArtifact_110118-1051"
}
]
},
{
"name": "compartmentId",
"source": "end_user",
"displayName": "Compartment ID",
"dataType": "string",
"mandatory": true,
"custom": false,
"cardinality": "SINGLE_VALUE"
}
]
}
]
}'
Response:
{
"message": "Successfully saved Template Resource for Template Id 16035011 ",
"entityId": "1603501 "
}