Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIC for CP4I tekton Pipeline #15

Open
andrew-suh opened this issue May 19, 2020 · 3 comments
Open

APIC for CP4I tekton Pipeline #15

andrew-suh opened this issue May 19, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@andrew-suh
Copy link
Contributor

This section needs to be finished.

@hollisc hollisc added the enhancement New feature or request label May 20, 2020
@hollisc
Copy link
Collaborator

hollisc commented May 20, 2020

Enhancement: Expand the ACE Tekton pipeline (https://github.com/ibm-cloud-architecture/gse-devops/tree/master/cloudpak-for-integration-tekton-pipelines) to include an additional Task to accomplish the following:

  1. Extract the generated OpenAPI json from the deployed ACE server.
  2. Import the json into APIC
  3. Publish api into a target APIC Catalog to be available for subscribers.

@hollisc
Copy link
Collaborator

hollisc commented May 20, 2020

Initial path was to explore usage of APIC cli to achieve the goals mentioned above but the APIC cli can only import api in a yaml format which required a converter to be created.

An alternative is to use the APIC REST API directly and import the json. This is the path we will work with next.

Here is a sample curl call to draft a rest API:

curl --location --request POST 'https://api.9.30.166.16.xip.io/api/orgs/jps-org/drafts/draft-apis' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "draft_api": { "swagger": "2.0", "info": { "title": "test-create-api-jps", "x-ibm-name": "test-create-api-jps", "version": "1.0.0" }, "host": "$(catalog.host)", "schemes": [ "https" ], "basePath": "/", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "client-id": [] } ], "securityDefinitions": { "client-secret": { "type": "apiKey", "description": "", "in": "header", "name": "X-IBM-Client-Secret" }, "client-id": { "type": "apiKey", "description": "", "in": "header", "name": "X-IBM-Client-Id" } }, "x-ibm-configuration": { "phase": "realized", "testable": true, "enforced": true, "properties": { "target-url": { "value": "http://example.com/operation-name", "description": "The URL of the target service", "encoded": false } }, "cors": { "enabled": true }, "application-authentication": { "certificate": false }, "assembly": { "execute": [ { "invoke": { "version": "2.0.0", "target-url": "https://api.us.apiconnect.ibmcloud.com/developmentoperations-apiconnect/", "title": "3 day forecast invocation", "cache-response": "time-to-live", "cache-key": "$(request.search)" } } ] }, "gateway": "datapower-api-gateway", "type": "rest" }, "tags": [ { "name": "test-jps-api", "description": "Sample API to get branches" } ], "paths": { "/jps-test": { "get": { "summary": "get all branches", "description": "get brnaches", "operationId": "jps-test", "tags": [ "Weather" ], "parameters": [ { "name": "zip", "type": "string", "in": "query", "description": "A 5 number zip code" }, { "name": "country", "type": "string", "in": "query", "description": "A 2 letter country code" } ], "responses": { "200": { "description": "Success", "schema": { "type": "integer" } }, "400": { "description": "Bad Request", "schema": { "type": "integer" } }, "408": { "description": "Request Timeout", "schema": { "type": "integer" } }, "500": { "description": "Internal Server Error", "schema": { "type": "integer" } } }, "consumes": [], "produces": [] } } } } }'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants