Using the Operations REST API

The data operations associated with deployments mapped to Oracle Integration Cloud or another generic integration provider are accessible through the Operations REST API. An operation describes the endpoint that has been registered against the operation. An operation also provides the data model to be used for requests sent when the operation is invoked, and the data model expected for responses received by the operation.

Example GET All Operations

The GET request URL looks like:

/opa-hub/api/12.2.16/operations

The response to a get all operations request looks like the following:

{
    "items": [
        {
            "name": "Deployment Load Operation v1",
            "type": "load",
            "state": "current",
            "version": 1,
            "interfaces": {
                "links": [
                    { "rel": "canonical", "href": "{server}/opa-hub/api/12.2.16/operations/Deployment%20Load%20Operation%20v1/interfaces" }
                ]
            },
            "links": // ??? standard links to the ???Deployment Load Operation v1??? resource ??? 
        },
        {
            "name": "Deployment Save Operation v1",
            "type": "save",
            "state": "current",
            "version": 1,
            "interfaces": {
                "links": [
                    { "rel": "canonical", "href": "{server}/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1/interfaces" }
                ]
            },
            "links": // ??? standard links to the ???Deployment Save Operation v1??? resource ??? 
        },
        // ??? more operations ???
    ],   
    "links": // ??? standard links to the operations resource ???    
}

Example GET Single Operation

The GET request URL looks like:

/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1

The response to a single operation request looks like the following:

{
    "name": "Deployment Save Operation v1",
    "type": "load",
    "state": "current",
    "version": 1,
    "invokeUrl": "{example-oic-server}/api/integration/v1/flows/rest_opa/MAPPING_LOAD/1.0/",
    "statusUrl": "{example-oic-server}/api/integration/v1/flows/rest_opa/MAPPING_LOAD/1.0/metadata",
    "queryParams": ["query-param-name-one", "query-param-name-two"],
    "interfaces": {
        "links": [
            { "rel": "canonical", "href": "{server}/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1/interfaces" }
        ]
    },
    "links": // ... standard links for the Operation resource ...
}

Example GET Single Operation, expand interfaces

The GET request URL looks like:

/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1?expand=interfaces

The response looks like the following:

{
    "name": "Deployment Save Operation v1",
    "type": "load",
    "state": "current",
    "version": 1,
    "invokeUrl": "{example-oic-server}/api/integration/v1/flows/rest_opa/MAPPING_LOAD/1.0/",
    "statusUrl": "{example-oic-server}/api/integration/v1/flows/rest_opa/MAPPING_LOAD/1.0/metadata",
    "queryParams": ["query-param-name-one", "query-param-name-two"],
    "interfaces": {
        "items": [
            {
                "name": "request",
                "properties": {
                    "save_number_attribute": { "type": "number" },
                    "save_boolean_attribute": { "type": "boolean" },
                    "save_text_attribute": { "type": "text" },
                    "sub_entity_one": {
                        "type": "containmentRelationship",
                        "properties": {
                            "save_sub_attribute_one": { "type": "boolean" },
                            "save_sub_attribute_two": { "type": "boolean" }
                        }
                    },
                    "reference_relationship_one": {
                        "type": "referenceRelationship",
                        "references": "sub_entity_one"
                    }

                },
                "links": // ...
            },
            {
                "name": "response",
                "properties": {
                    "sub_entity_one": {
                        "type": "containmentRelationship",
                        "properties": {
                            "load_after_submit_attribute": { "type": "boolean" }
                        }
                    },
                    "reference_relationship_one": {
                        "type": "referenceRelationship",
                        "references": "sub_entity_one"
                    },
                    "load_after_submit_boolean_attribute": {"type": "boolean" },
                    "load_after_submit_text_attribute": { "type": "text" } 
                },
                "links": // ...
            }
       ]
    },
    "links": // ... standard links for the Operation resource ...
}

Example GET All Operation Interfaces

The GET request to retrieve all operation interfaces looks like:

/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1/interfaces

The response looks like the following:

{
   "items": [
            {
                "name": "request",
                "properties": {
                    "save_number_attribute": { "type": "number" },
                    "save_boolean_attribute": { "type": "boolean" },
                    "save_text_attribute": { "type": "text" },
                    "sub_entity_one": {
                        "type": "containmentRelationship",
                        "properties": {
                            "save_sub_attribute_one": { "type": "boolean" },
                            "save_sub_attribute_two": { "type": "boolean" }
                        }
                    },
                    "reference_relationship_one": {
                        "type": "referenceRelationship",
                        "references": "sub_entity_one"
                    }

                },
                "links": // ...
            },
            {
                "name": "response",
                "properties": {
                    "sub_entity_one": {
                        "type": "containmentRelationship",
                        "properties": {
                            "load_after_submit_attribute": { "type": "boolean" }
                        }
                    },
                    "reference_relationship_one": {
                        "type": "referenceRelationship",
                        "references": "sub_entity_one"
                    },
                    "load_after_submit_boolean_attribute": {"type": "boolean" },
                    "load_after_submit_text_attribute": { "type": "text" } 
                },
                "links": // ...
            }
       ]
    "links": // ...
}

Example GET Single Operation Interface

The GET request URL looks like:

/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1/interfaces/request

The response looks like the following:

{
    "name": "request",
    "properties": {
        "save_number_attribute": { "type": "number" },
        "save_boolean_attribute": { "type": "boolean" },
        "save_text_attribute": { "type": "text" },
        "sub_entity_one": {
            "type": "containmentRelationship",
            "properties": {
                "save_sub_attribute_one": { "type": "boolean" },
                "save_sub_attribute_two": { "type": "boolean" }
            }
        },
        "reference_relationship_one": {
            "references": "sub_entity_one",
            "type": "referenceRelationship"
        }
    },
    "links": // ...
}

Example PUT Single Operation

The PUT request URL for updating a single operation looks like:

/opa-hub/api/12.2.16/operations/Deployment%20Save%20Operation%20v1

The basic structure expected for the PUT request for updating a single operation looks like:

{
   "name":" Deployment Save Operation v1",
   "invokeUrl":"{example-oic-server}/api/integration/v1/flows/rest_opa/SAVE_INTEGRATION/1.0/",
   "statusUrl":"{example-oic-server}/api/integration/v1/flows/rest_opa/SAVE_INTEGRATION/1.0/metadata",
   "queryParams":["expected-query-param-name-one", "expected-query-param-name-two"]
}

When updating an operation via PUT request, the name property must match the name of the operation being updated, and the invokeUrl, statusUrl, and queryParams properties must have a value to be applied to the operation resource.