{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "Automation Services Registration API",
    "version" : "1.0.0"
  },
  "servers" : [ {
    "url" : "/@context_root@/v1",
    "description" : "Automation Services Registration API"
  } ],
  "paths" : {
    "/about" : {
      "get" : {
        "tags" : [ "Automation Services Registration API" ],
        "summary" : "About Automation Services Registration API",
        "description" : "The Automation Services Registration API (ASRA) is a public web API for publishing decision services as automation services.",
        "operationId" : "about",
        "responses" : {
          "200" : {
            "description" : "Information about the Automation Services Registration API was successfully retrieved",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AboutInformation"
                }
              }
            }
          },
          "500" : {
            "description" : "Information about the Automation Services Registration API could not be retrieved due to an internal error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          }
        }
      }
    },
    "/health" : {
      "get" : {
        "tags" : [ "Automation Services Registration API" ],
        "summary" : "Status of the service",
        "description" : "Retrieve the status of the service",
        "operationId" : "health",
        "responses" : {
          "200" : {
            "description" : "The status of the service was successfully retrieved",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Health"
                }
              }
            }
          },
          "500" : {
            "description" : "The status of the service could not be retrieved due to an internal error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          }
        }
      }
    },
    "/deploymentSpaces/{deploymentSpaceId}/decisions/{decisionId}" : {
      "put" : {
        "tags" : [ "Automation Services Registration API" ],
        "summary" : "Publish an automation service",
        "description" : "Publish an automation service",
        "operationId" : "publish",
        "parameters" : [ {
          "name" : "deploymentSpaceId",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "decisionId",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/RequestPayload"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "The automation service is published"
          },
          "401" : {
            "description" : "Cannot perform this operation due to an authentication problem",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "403" : {
            "description" : "No sufficient privileges to execute the operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "404" : {
            "description" : "The decision service could not be found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "500" : {
            "description" : "The operation could not be executed due to an internal error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        }, {
          "bearerTokenAuth" : [ ]
        } ]
      },
      "delete" : {
        "tags" : [ "Automation Services Registration API" ],
        "summary" : "Unpublish an automation service",
        "description" : "Unpublish an automation service",
        "operationId" : "unPublish",
        "parameters" : [ {
          "name" : "deploymentSpaceId",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "decisionId",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "The automation service is unpublished"
          },
          "401" : {
            "description" : "Cannot perform this operation due to an authentication problem",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "403" : {
            "description" : "No sufficient privileges to execute the operation",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "404" : {
            "description" : "The decision service could not be found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          },
          "500" : {
            "description" : "The operation could not be executed due to an internal error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/BaseError"
                }
              }
            }
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        }, {
          "bearerTokenAuth" : [ ]
        } ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "AboutInformation" : {
        "type" : "object",
        "properties" : {
          "vendor" : {
            "type" : "string",
            "description" : "The product vendor."
          },
          "product" : {
            "type" : "string",
            "description" : "The product name."
          },
          "component" : {
            "type" : "string",
            "description" : "The product component name."
          },
          "version" : {
            "type" : "string",
            "description" : "The Automation Service Registration API version."
          },
          "commit" : {
            "type" : "string",
            "description" : "Git commit id"
          },
          "date" : {
            "type" : "string",
            "description" : "Build date"
          },
          "license" : {
            "type" : "string",
            "description" : "The license version for IBM Decision Intelligence Client Managed Software"
          },
          "runtime" : {
            "type" : "string",
            "description" : "The decision runtime version"
          },
          "swagger_ui" : {
            "type" : "string",
            "description" : "The SwaggerUI version"
          },
          "etcd" : {
            "type" : "string",
            "description" : "The ETCD version"
          }
        },
        "description" : "Information about the ADS Automation Service Registration API."
      },
      "BaseError" : {
        "type" : "object",
        "properties" : {
          "incident" : {
            "$ref" : "#/components/schemas/Incident"
          }
        }
      },
      "Incident" : {
        "type" : "object",
        "properties" : {
          "incidentId" : {
            "type" : "string",
            "description" : "A unique identifier for the incident."
          },
          "incidentCategory" : {
            "type" : "string",
            "description" : "The category of the incident."
          },
          "stackTrace" : {
            "type" : "string",
            "description" : "An associated stack trace. By default, the stack trace is null."
          }
        },
        "description" : "The description of the failure."
      },
      "Health" : {
        "type" : "object",
        "properties" : {
          "status" : {
            "type" : "string",
            "description" : "The ASRA health.",
            "enum" : [ "PASS", "FAIL", "WARN" ]
          },
          "runtimeServiceStatus" : {
            "type" : "string",
            "description" : "The readiness status of the decision runtime service.",
            "enum" : [ "READY", "NOT_READY" ]
          },
          "registryStatus" : {
            "type" : "string",
            "description" : "The readiness status of the registry service.",
            "enum" : [ "READY", "NOT_READY" ]
          }
        },
        "description" : "The health status of ASRA."
      },
      "RequestPayload" : {
        "type" : "object",
        "properties" : {
          "automationServiceId" : {
            "type" : "string",
            "description" : "The identifier of the automation service.",
            "example" : "/dba/automation_service/decision/<serviceId>"
          },
          "automationServiceVersionedId" : {
            "type" : "string",
            "description" : "The identifier of this particular version of the automation service.",
            "example" : "/dba/automation_service/decision/<serviceVersionedId>"
          }
        },
        "description" : "The automation service payload."
      }
    },
    "securitySchemes" : {
      "basicAuth" : {
        "type" : "http",
        "scheme" : "basic"
      },
      "bearerTokenAuth" : {
        "type" : "http",
        "scheme" : "bearer"
      }
    }
  }
}