Import API

Use this API to import artifacts from a content archive. Archives are created via the export REST API, the content archive tool, or the Cloud Service Management Console. The import operation imports the primary artifact and all associated artifacts.

Base URL

https://<host>:<port>/csa/rest

Details

URI /import
Method POST
Parameters

userIdentifier=<user_id>
    Required; the user ID you want to use as credentials for this API call. This user should be a consumer user who has the necessary permissions for the data you want to work with. See Get userIdentifier for the steps required to get the userIdentifier value.

previewImport=[true|false]
Optional; default is false. If true, then the file will only be validated to determine that an import can succeed, without actually performing an import.

file=<multipart_representation_of_service_offering_zip_file>
    Required; type 'Multipart/Form-Data' archive zip to be imported. Note that the directory the file will be imported from is defined by the REST client or browser in use. Typically the file parameter will not include a directory path. 

update=[true|false]
    Optional; default is false. If true, any existing artifacts of the same type and with the same name will be overwritten; otherwise the artifacts are created. Cannot be used with updatePreserveExisting parameter.

updatePreserveExisting=[true|false]
    Optional; default is false.  If true, any existing artifacts of the same type with the same name will be preserved (not overwritten) and renamed.  Existing references to these artifacts will automatically use the renamed artifacts.  New artifacts are created from the archive. Cannot be used with update parameter.

orgForCatalogImport=<organization_name>
    Required for import of catalog archive; the name of the organization to be used when creating the imported catalog.

associateProviders=[true|false]
    Optional; default is false. If true, resource providers in the archive are bound to existing resource offerings and resource environments of the same provider type and display name in the database.

validateType=[COMPONENT_PALETTE|CATALOG|SERVICE_OFFERING|SERVICE_BLUEPRINT|SERVICE_DESIGN|RESOURCE_OFFERING|RESOURCE_ENVIRONMENT]
    Optional; if specified, content archive is verified to be of the specified type. ||

Returns 200 - Updated
400 - Bad request
404 - Not found
500 - Server exception

Caution Component palette import is an update operation, and so associateProviders and updatePreserveExisting parameters will be ignored.

The following headers must be set when using this API to upload the content archive:

  • Content-type: multipart/form-data
  • Content-Disposition: form-data; name="file"
  • Content-Type: application/octet-stream

Example

The following URL was sent to import the contents of the specified archive.https://<host>:<port>/csa/rest/import?userIdentifier=90d96588360da0c701360da0f1d5f483&update=true&file=SERVICE_OFFERING_SO_ONE_90cec2ff3c81b896013c81b8c1780097.zip

The following XML was returned:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ImportOperationResult>
  <additionalSummaryMessages>
    Service offering SO ONE imported successfully. (Id=90cec2ff3dc1d73b013dc1df0b750028)
  </additionalSummaryMessages>
  <additionalSummaryMessages>
    Service design SD ONE imported successfully. (Id=90cec2ff3dc1d73b013dc1df09db0018)
  </additionalSummaryMessages>
  <importResultRecord>ea933ec5-ad7b-42b6-b47c-965ff76f7693</importResultRecord>
  <importStatus>SUCCESS</importStatus>
  <importSummary>Import of Service offering archive successful.</importSummary>
</ImportOperationResult>