Import (Register) a Library in a Project
post
/ic/api/integration/v1/projects/{projectId}/libraries/archive
Imports an API library jar file in a project. If you are using cURL, use the -F option to specify the file to import. The request must contain the following attributes added with the -F option: name, code, version, type, and file. Description is optional.
Request
Path Parameters
-
projectId(required): string
Project identifier
Query Parameters
-
integrationInstance(required): string
This is the name of the service instance. You can get this value from the About page where it is specified in the Service instance field.
Supported Media Types
- multipart/form-data
Root Schema : schema
Type:
Show Source
object
-
code: string
Library identifier
-
description: string
Library description
-
file: string
(binary)
Library artifact file content
-
name: string
Library name
-
type: string
Library type
-
version: string
Library version
Response
Supported Media Types
- application/json; charset=utf-8
204 Response
Successful operation, no content sent, the Location header provides the newly created library uri
400 Response
Malformed parameters
409 Response
Library already exists
500 Response
Server error
Examples
The following example shows how to import a JavaScript library in a project by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL. For more information about endpoint URL structure, see Send Requests.
Example: Import a Library in the project TEST_PROJECT
This command imports a JavaScript API Library. The request must contain the following
attributes specified with the -F
option: name
,
code
, version
, type
and
file
. Description is optional.
curl -X POST -H 'Authorization: Bearer access_token' -H "Content-Type:multipart/form-data" -F "name=JSFILE_NAME" -F "code=JS_CODE" -F "version=01.00.0000" -F "description=JavaScript library description" -F "type=API" -F "file=@JSFILE_01.00.0000.jar" https://design.integration.region.ocp.oraclecloud.com/ic/api/integration/v1/projects/TEST_PROJECT/libraries/archive?integrationInstance=service-instance