Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- swagger: "2.0"
- info:
- description: This API is for Service Providers that are coming into IBM Cloud Private
- For Data
- title: Service Provider API Spec
- license:
- name: (c) IBM. All rights reserved
- version: Beta
- basePath: /v1
- paths:
- /grant:
- post:
- description: Its expected that the Admin (originally the creator of the service
- instance) grants access to Zen users. This post action allows the user to
- get some rights to work with the service instance. This action can only triggered
- by the owner of the service instance resource or an admin. A role/privilege
- in the service instance may also be associated with this user.
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - users
- summary: Associate one or more users to the service instance.
- operationId: addUserToServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: ServiceInstance metadataartifact that needs to be added to the
- Database
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/AddUsersSchema'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessPostResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "409":
- description: Resource Already Exists
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /job/details/{jobid}:
- post:
- description: Given the service instane id and job id, this api returns details
- about the particular job.
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - jobs
- summary: Returns the job details for a particular instance.
- operationId: getJobDetails
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - type: string
- description: jobid for which we want the details
- name: jobid
- in: path
- required: true
- - description: meta information about the serviceInstance that was provisioned.
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/Job'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /job/logs/{jobid}:
- post:
- description: Given the service instane id and job id, this api returns Logs
- about the particular job.
- consumes:
- - application/json
- produces:
- - application/octet-stream
- tags:
- - jobs
- summary: Returns the job logs for a particular job.
- operationId: getJobLogs
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - type: string
- description: jobid for which we want the details
- name: jobid
- in: path
- required: true
- - description: meta information about the serviceInstance that was provisioned.
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- type: string
- format: binary
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /job/{jobid}:
- delete:
- description: Given the job id and service instance id, this api deletes the
- job and returns the response.
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - jobs
- summary: Delete a particular job
- operationId: DeleteJob
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - type: string
- description: jobid for which we want the details
- name: jobid
- in: path
- required: true
- - description: meta information about the serviceInstance that was provisioned.
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /jobs:
- post:
- description: Given the service instane id, returns the list of jobs with along
- with some metadata.
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - jobs
- summary: Returns the list of jobs associated with the service instance.
- operationId: getJobs
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: meta information about the serviceInstance that was provisioned.
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessJobsResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /monitor:
- get:
- tags:
- - monitor
- summary: checks whether the server is up
- operationId: getMonitor
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessGetResponse'
- default:
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /monitorServiceInstance:
- post:
- description: returns the details like connection-info, metadata and statis of
- the provisioned instance of an addon.
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - provisioner
- summary: monitor the status of the provisioned service Instance and returns
- the details of the provisioned service instance.
- operationId: monitorProvisionedServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: meta information about the serviceInstance that was provisioned.
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessMonitorResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /provision:
- post:
- description: this api provisions a new service instance in ICP for Data
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - provisioner
- summary: Provision a new Service Instance
- operationId: postServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: information about the service instance that needs to be provisioned
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessPostResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- delete:
- description: This deletes the actual service instance and only returns success
- response on successfull deletion of the instance and all the users associated
- to that database
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - provisioner
- summary: deletes the service instance (including all users in that service
- instance)
- operationId: deleteServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: jwt based Authorization bearer token
- name: Authorization
- in: header
- - description: meta information about the service instance that needs to be
- deprovisioned
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/ServiceInstanceMetadata'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /provisionstatus:
- get:
- tags:
- - provisioner
- summary: Get the Status of the service instance and the Progress of provisioning
- operationId: getProvisionStatus
- parameters:
- - type: string
- description: The Service Instance ID of the service instance
- name: SID
- in: query
- required: true
- - type: string
- description: The Namespace that the service instance is in
- name: namespace
- in: query
- required: true
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessProvisionStatusResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /revoke:
- delete:
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - users
- summary: deletes multiple users associations for this service instance from
- the database
- operationId: deleteServiceInstanceUser
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: arrays of usernames to delete
- name: body
- in: body
- required: true
- schema:
- $ref: '#/definitions/RevokeUsersSchema'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /serviceInstance/users/password:
- patch:
- description: Can only be done by the user who belongs to the service instance
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - users
- summary: Updates user password for a service instance.
- operationId: patchUserPasswordServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: ServiceInstance metadataartifact that needs to be added to the
- Database
- name: body
- in: body
- schema:
- $ref: '#/definitions/PatchPasswordSchema'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /serviceInstance/users/role:
- patch:
- description: Can only be done by an "Admin" or equivalent role in the service
- instance
- consumes:
- - application/json
- produces:
- - application/json
- tags:
- - users
- summary: Updates user role for a service instance.
- operationId: patchUserRoleServiceInstance
- parameters:
- - type: string
- description: Added by zen-core-api to identify the current user that triggered
- the request
- name: jwt-auth-user-payload
- in: header
- - type: string
- description: Basic Authorization token which is generated and unique to each
- service provider. This will need be used by service broker to talk to service
- provider
- name: Authorization
- in: header
- - description: ServiceInstance metadataartifact that needs to be added to the
- Database
- name: body
- in: body
- schema:
- $ref: '#/definitions/PatchUserRoleSchema'
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- /storageclasses:
- get:
- tags:
- - storage
- summary: gets the available storage classes
- operationId: getStorageClasses
- responses:
- "200":
- description: Success
- schema:
- $ref: '#/definitions/SuccessStorageClassesResponse'
- "400":
- description: Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- "401":
- description: Unauthorized
- schema:
- $ref: '#/definitions/ErrorResponse'
- "404":
- description: Not found
- schema:
- $ref: '#/definitions/ErrorResponse'
- "500":
- description: Internal Server Error
- schema:
- $ref: '#/definitions/ErrorResponse'
- definitions:
- AddUsersSchema:
- type: object
- properties:
- CurrentUserRecord:
- $ref: '#/definitions/CurrentUserRecord'
- ServiceInstanceMetadata:
- $ref: '#/definitions/ServiceInstanceMetadata'
- users:
- type: array
- items:
- $ref: '#/definitions/ServiceInstanceUsersMetadata'
- CurrentUserRecord:
- type: object
- required:
- - uid
- - role
- - username
- properties:
- SID:
- type: string
- display_name:
- type: string
- password:
- type: string
- role:
- type: string
- service_username:
- type: string
- uid:
- type: string
- username:
- type: string
- ErrorResponse:
- type: object
- properties:
- _messageCode_:
- description: error code
- type: string
- _statusCode_:
- description: http error code
- type: integer
- format: int32
- exception:
- description: string representation of the error
- type: string
- message:
- description: error message
- type: string
- Job:
- type: object
- properties:
- job_creation_date:
- description: Creation Date of the job
- type: string
- job_id:
- description: ID of the job
- type: string
- job_name:
- description: Name of the job
- type: string
- job_status:
- description: status of the job
- type: string
- job_submitted_by:
- description: Username of person who sumbitted the job
- type: string
- job_type:
- description: Type of the job
- type: string
- payload_obj:
- description: free-form metadata object that can contain information about
- the job
- type: object
- project_id:
- description: id of the watson studio project from which the job was kicked
- off
- type: string
- PatchPasswordSchema:
- type: object
- properties:
- CurrentUserRecord:
- $ref: '#/definitions/CurrentUserRecord'
- ServiceInstanceMetadata:
- $ref: '#/definitions/ServiceInstanceMetadata'
- newpassword:
- type: string
- oldpassword:
- type: string
- username:
- type: string
- example: admin
- PatchUserRoleSchema:
- type: object
- properties:
- CurrentUserRecord:
- $ref: '#/definitions/CurrentUserRecord'
- ServiceInstanceMetadata:
- $ref: '#/definitions/ServiceInstanceMetadata'
- users:
- type: array
- items:
- $ref: '#/definitions/UserRoleSchema'
- RevokeUsersSchema:
- type: object
- properties:
- CurrentUserRecord:
- $ref: '#/definitions/CurrentUserRecord'
- ServiceInstanceMetadata:
- $ref: '#/definitions/ServiceInstanceMetadata'
- users:
- type: array
- items:
- description: array of usernames to delete
- type: string
- ServiceInstanceMetadata:
- type: object
- properties:
- metadata:
- description: this is all the metadata provided by User while provisioning.
- type: object
- parameters:
- description: parameters in the form of key value pair that are needed as part
- of provision
- type: object
- serviceInstanceDescription:
- type: string
- serviceInstanceDisplayName:
- type: string
- serviceInstanceNamespace:
- description: the namespace of provisioned service Instance
- type: string
- transientFields:
- type: object
- zenServiceInstanceInfo:
- $ref: '#/definitions/ZenServiceInstanceInfo'
- ServiceInstanceUsersMetadata:
- type: object
- properties:
- password:
- type: string
- role:
- type: string
- uid:
- type: string
- username:
- type: string
- SuccessGetResponse:
- type: object
- properties:
- _messageCode_:
- description: message code
- type: string
- message:
- description: message
- type: string
- requestObj:
- type: object
- status:
- description: message
- type: string
- SuccessGetStatus:
- type: object
- properties:
- status:
- description: status of the string
- type: string
- SuccessJobDetailsResponse:
- type: object
- properties:
- _statusCode_:
- description: 200 success code
- type: integer
- details:
- type: object
- SuccessJobsResponse:
- type: object
- properties:
- _statusCode_:
- description: 200 success Code
- type: integer
- jobs:
- type: array
- items:
- $ref: '#/definitions/Job'
- SuccessMonitorResponse:
- type: object
- properties:
- connection-info:
- type: object
- message:
- type: string
- metadata:
- type: object
- status:
- type: string
- SuccessPostResponse:
- type: object
- properties:
- message:
- description: success message
- type: string
- metadata:
- description: response obj that will be saved in zenmetastore db
- type: object
- SuccessProvisionStatusResponse:
- type: object
- properties:
- message:
- type: string
- provision_progress:
- type: string
- status:
- type: string
- SuccessResponse:
- type: object
- properties:
- _messageCode_:
- description: message code
- type: string
- message:
- description: message
- type: string
- SuccessStorageClassesResponse:
- type: object
- properties:
- _messageCode_:
- description: message code
- type: string
- message:
- description: message
- type: string
- storage_classes:
- type: array
- items:
- description: name of the storage class
- type: string
- UserRoleSchema:
- type: object
- required:
- - username
- - role
- properties:
- role:
- type: string
- example: user or admin
- username:
- type: string
- example: admin
- ZenServiceInstanceInfo:
- type: object
- properties:
- zenControlPlaneNamespace:
- description: the namespace where Service Broker (zen-core-api in this case)
- resides. "zen" might not be the namespace where icp4d is installed.
- type: string
- zenServiceInstanceId:
- description: serviceInstanceId of the provisioned database
- type: string
- zenServiceInstanceSecret:
- description: default password generated by zen-core-api.
- type: string
- zenServiceInstanceType:
- description: the type of serviceInstance. e.g db2wh, eventstore, mongodb etc.
- type: string
- zenServiceInstanceUID:
- description: zen service instane uid
- type: string
- zenServiceInstanceUserName:
- description: zen service instane username
- type: string
- zenServiceInstanceVersion:
- description: version of the type.
- type: string
- tags:
- - name: monitor
- - description: API to launch service instances when invoked by a ICP for Data user
- with right permissions
- name: provisioner
- - name: storage
- - name: users
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement