{
  "openapi": "3.1.0",
  "info": {
    "title": "Cloudidr Disaster Recovery (DR) API",
    "description": "API for managing disaster recovery and cyber resilience policies.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://public-api.cloudidr.com",
      "description": "Production server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/external/api/v1/sign-in": {
      "post": {
        "summary": "Sign In",
        "description": "Authenticate and obtain an access token for API requests.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successfully authenticated"
          }
        }
      }
    },
    "/external/api/v1/policies/cyber/{cid_ext}/customer": {
      "get": {
        "summary": "List of Cyber Policies",
        "description": "Retrieve a paginated list of cyber/DR policies for a specific customer with optional filtering and sorting.",
        "parameters": [
          {
            "name": "cid_ext",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "External customer ID. This value uniquely identifies the customer whose cyber policies are being queried."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "The page number for paginated results. Defaults to 1 if not provided."
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "The number of records per page. Defaults to 10 if not provided."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            },
            "description": "Sorts the policies by their creation date in descending order by default."
          },
          {
            "name": "policyStatus",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "READY_FOR_PURCHASE",
                "ACTIVE",
                "CANCELED",
                "COMPLETED"
              ]
            },
            "description": "The status code for filtering policies. Allowed values: READY_FOR_PURCHASE, ACTIVE, CANCELED, COMPLETED."
          },
          {
            "name": "policyName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter results by the policy name."
          }
        ],
        "responses": {
          "200": {
            "description": "Success - Returns paginated list of cyber policies",
            "content": {
              "application/json": {
                "examples": {
                  "withResults": {
                    "summary": "Success with results",
                    "description": "Paginated list of cyber policies"
                  },
                  "noResults": {
                    "summary": "Success - No results found",
                    "value": {
                      "page": 0,
                      "pageSize": 20,
                      "totalPageNumbers": 0,
                      "totalElements": 0,
                      "values": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/policies/cyber/{cidr_id}/view": {
      "get": {
        "summary": "Describe Cyber Policy",
        "description": "This response provides detailed view information for a cyber policy, including policy details, region settings, instances, dates, disaster recovery events, and pricing.",
        "parameters": [
          {
            "name": "cidr_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identifier representing the cyber policy or customer view. This ID is used to retrieve detailed view information."
          }
        ],
        "responses": {
          "200": {
            "description": "Success - Returns detailed cyber policy information"
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing cyber policy view",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr rFVrfliRmYgD1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/policies/cyber/initiate/{cidr_id}": {
      "post": {
        "summary": "Initiate DR Event",
        "description": "Initiate a disaster recovery event for a cyber policy. A unique identifier representing the cyber policy or customer view.",
        "parameters": [
          {
            "name": "cidr_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identifier representing the cyber policy or customer view. This ID is used to retrieve detailed view information."
          }
        ],
        "responses": {
          "200": {
            "description": "Event Already Triggered - A DR event has already been initiated for the provided cyber policy",
            "content": {
              "application/json": {
                "example": {
                  "code": 200,
                  "data": {
                    "id": null
                  },
                  "message": "allocation event already triggered"
                }
              }
            }
          },
          "201": {
            "description": "Event Created - A new DR event has been successfully created",
            "content": {
              "application/json": {
                "example": {
                  "code": 201,
                  "data": {
                    "id": null
                  },
                  "message": "event row created"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing cyber policy view",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr rFVrfliRmYgD1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/policies/cyber/terminate/{cidr_id}": {
      "post": {
        "summary": "Terminate DR Event",
        "description": "Terminate a disaster recovery event for a cyber policy. A unique identifier representing the cyber policy or customer view.",
        "parameters": [
          {
            "name": "cidr_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identifier representing the cyber policy or customer view. This ID is used to retrieve detailed view information."
          }
        ],
        "responses": {
          "200": {
            "description": "Event Already Triggered - A termination event has already been initiated for the provided cyber policy",
            "content": {
              "application/json": {
                "example": {
                  "code": 200,
                  "data": {
                    "id": null
                  },
                  "message": "termination event already triggered"
                }
              }
            }
          },
          "201": {
            "description": "Event Created - A termination of DR event has been successfully created",
            "content": {
              "application/json": {
                "example": {
                  "code": 201,
                  "data": {
                    "id": null
                  },
                  "message": "event row created"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing cyber policy view",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr rFVrfliRmYgD1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}