{
    "swagger":"2.0",
    "info":{
        "description":"Oracle APIs for policy cache diagnostics",
        "version":"2025.02.19",
        "title":"Oracle Policy Cache Diagnostics",
        "x-summary":"Oracle APIs for policy cache diagnostics"
    },
    "schemes":[
        "http",
        "https"
    ],
    "consumes":[
        "application/json",
        "application/xml"
    ],
    "produces":[
        "application/json",
        "application/xml"
    ],
    "tags":[
        {
            "name":"Policy Cache Diagnostics (Admin)",
            "description":"The operations from the Policy Cache Diagnostics (Admin) category."
        },
        {
            "name":"Policy Cache Diagnostics (Server)",
            "description":"The operations from the Policy Cache Diagnostics (Server) category."
        },
        {
            "name":"Policy Cache Info (Admin)",
            "description":"The operations from the Policy Cache Info (Admin) category."
        }
    ],
    "paths":{
        "/iam/admin/diag/api/v1/policycache/status":{
            "get":{
                "summary":"Policy Cache Diagnostics Information",
                "description":"Get information related to server policy cache diagnostics for all managed servers.\n",
                "parameters":[
                    {
                        "name":"verbose",
                        "in":"query",
                        "description":"Flag for returning detailed output",
                        "type":"string",
                        "required":false
                    }
                ],
                "tags":[
                    "Policy Cache Diagnostics (Admin)"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "schema":{
                            "$ref":"#/definitions/PolicyDiagnostics"
                        }
                    },
                    "424":{
                        "description":"Failed Dependency"
                    },
                    "401":{
                        "description":"Not authorized."
                    },
                    "default":{
                        "description":"Unexpected error"
                    }
                },
                "x-internal-id":"iam-admin-diag-api-v1-policycache-status-get",
                "x-filename-id":"iam-admin-diag-api-v1-policycache-status-get"
            }
        },
        "/iam/admin/diag/api/v1/policycache/refresh":{
            "put":{
                "summary":"Policy Cache Diagnostics Refresh",
                "description":"Refresh server policy cache on all managed servers.\n",
                "tags":[
                    "Policy Cache Diagnostics (Admin)"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshResults"
                        }
                    },
                    "422":{
                        "description":"Unprocessable Entity",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshResults"
                        }
                    },
                    "424":{
                        "description":"Failed Dependency",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshResults"
                        }
                    },
                    "401":{
                        "description":"Not authorized."
                    },
                    "default":{
                        "description":"Unexpected error"
                    }
                },
                "x-internal-id":"iam-admin-diag-api-v1-policycache-refresh-put",
                "x-filename-id":"iam-admin-diag-api-v1-policycache-refresh-put"
            }
        },
        "/iam/access/diag/api/v1/policycache/status":{
            "get":{
                "summary":"Policy Cache Diagnostics Information",
                "description":"Get information related to server policy cache diagnostics.\n",
                "parameters":[
                    {
                        "name":"verbose",
                        "in":"query",
                        "description":"Flag for returning detailed output",
                        "type":"string",
                        "required":false
                    }
                ],
                "tags":[
                    "Policy Cache Diagnostics (Server)"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "schema":{
                            "$ref":"#/definitions/PolicyDiagnosticsData"
                        }
                    },
                    "401":{
                        "description":"Not authorized."
                    },
                    "424":{
                        "description":"Failed Dependency"
                    },
                    "default":{
                        "description":"Unexpected error"
                    }
                },
                "x-internal-id":"iam-access-diag-api-v1-policycache-status-get",
                "x-filename-id":"iam-access-diag-api-v1-policycache-status-get"
            }
        },
        "/iam/access/diag/api/v1/policycache/refresh":{
            "put":{
                "summary":"Policy Cache Diagnostics Refresh Cache",
                "description":"Refresh server policy cache.\n",
                "tags":[
                    "Policy Cache Diagnostics (Server)"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshData"
                        }
                    },
                    "422":{
                        "description":"Unprocessable Entity",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshData"
                        }
                    },
                    "424":{
                        "description":"Failed Dependency",
                        "schema":{
                            "$ref":"#/definitions/PolicyCacheRefreshData"
                        }
                    },
                    "401":{
                        "description":"Not authorized."
                    },
                    "default":{
                        "description":"Unexpected error"
                    }
                },
                "x-internal-id":"iam-access-diag-api-v1-policycache-refresh-put",
                "x-filename-id":"iam-access-diag-api-v1-policycache-refresh-put"
            }
        },
        "/iam/admin/ssa/api/v1/policycacheadmin/policycache":{
            "post":{
                "summary":"Build policy cache from the current policies",
                "description":"Build policy cache with the current policies in the OAM database. While the policy cache is being built, the runtime servers will still be using the existing policy cache.\n",
                "parameters":[
                    {
                        "in":"body",
                        "name":"body",
                        "description":"Policy cache request",
                        "required":true,
                        "schema":{
                            "$ref":"#/definitions/CacheUpdateRequest"
                        }
                    }
                ],
                "tags":[
                    "Policy Cache Info (Admin)"
                ],
                "responses":{
                    "200":{
                        "description":"Policy Cache info fetched successfully.",
                        "schema":{
                            "$ref":"#/definitions/CacheUpdateResponse"
                        }
                    },
                    "401":{
                        "description":"Not authorized."
                    },
                    "500":{
                        "description":"Internal Server Error"
                    }
                },
                "x-internal-id":"iam-admin-ssa-api-v1-policycacheadmin-policycache-post",
                "x-filename-id":"iam-admin-ssa-api-v1-policycacheadmin-policycache-post"
            }
        }
    },
    "definitions":{
        "PolicyDiagnosticsData":{
            "type":"object",
            "properties":{
                "clusterName":{
                    "type":"string",
                    "description":"Name of cluster"
                },
                "serverName":{
                    "type":"string",
                    "description":"Name of server"
                },
                "serverIp":{
                    "type":"string",
                    "description":"IP Address of server"
                },
                "serverPort":{
                    "type":"string",
                    "description":"Port of server"
                },
                "isMDCEnabled":{
                    "type":"string",
                    "description":"Is MDC enabled"
                },
                "isMaster":{
                    "type":"string",
                    "description":"Is Master"
                },
                "createTime":{
                    "type":"string",
                    "description":"Create time"
                },
                "policyCacheUpdateTime":{
                    "type":"string",
                    "description":"Update time of policy cache"
                },
                "policyCacheUpdateStatus":{
                    "type":"string",
                    "description":"Update status of policy cache"
                },
                "policyCacheCheckSum":{
                    "type":"string",
                    "description":"Checksum of policy cache"
                },
                "policyCacheVersion":{
                    "type":"string",
                    "description":"Version of policy cache"
                },
                "totalAppDomains":{
                    "type":"string",
                    "description":"Number of app domains"
                },
                "totalAuthNPolicies":{
                    "type":"string",
                    "description":"Number of AuthN policies"
                },
                "totalAuthZPolicies":{
                    "type":"string",
                    "description":"Number of AuthZ policies"
                },
                "totalResources":{
                    "type":"string",
                    "description":"Number of resources"
                },
                "totalHostIds":{
                    "type":"string",
                    "description":"Number of Host IDs"
                },
                "totalTokenPolicies":{
                    "type":"string",
                    "description":"Number of token policies"
                },
                "lastPolicyUptakeTimeMillis":{
                    "type":"string",
                    "description":"Last policy cache uptake in milliseconds"
                }
            },
            "required":[
                "serverName",
                "serverIp",
                "serverPort",
                "isMDCEnabled",
                "isMaster",
                "policyCacheUpdateTime",
                "policyCacheVersion",
                "totalAppDomains",
                "totalAuthNPolicies",
                "totalAuthZPolicies",
                "totalResources",
                "totalHostIds",
                "totalTokenPolicies",
                "lastPolicyUptakeTimeMillis"
            ]
        },
        "PolicyCacheRefreshData":{
            "type":"object",
            "properties":{
                "serverName":{
                    "type":"string",
                    "description":"Name of server"
                },
                "policyCacheVersion":{
                    "type":"string",
                    "description":"Policy cache version"
                },
                "refreshRequestTime":{
                    "type":"string",
                    "description":"Policy cache refresh request time"
                },
                "responseCode":{
                    "type":"string",
                    "description":"Response code"
                },
                "minorResponseCode":{
                    "type":"string",
                    "description":"Minor response code"
                },
                "message":{
                    "type":"string",
                    "description":"Response message"
                }
            },
            "required":[
                "serverName",
                "policyCacheVersion",
                "refreshRequestTime",
                "responseCode"
            ]
        },
        "PolicyDiagnostics":{
            "type":"object",
            "properties":{
                "isAllCacheVersionMatched":{
                    "type":"string",
                    "description":"All returned servers have matching policy cache version. (true/false)"
                },
                "policyDiagnosticsData":{
                    "type":"array",
                    "items":{
                        "$ref":"#/definitions/PolicyDiagnosticsData"
                    }
                }
            },
            "required":[
                "isAllCacheVersionMatched",
                "policyDiagnosticsData"
            ]
        },
        "PolicyCacheRefreshResults":{
            "type":"array",
            "items":{
                "$ref":"#/definitions/PolicyCacheRefreshData"
            }
        },
        "CacheUpdateRequest":{
            "type":"object",
            "properties":{
                "forceUpdate":{
                    "type":"boolean",
                    "description":"Whether to forceupdate the policy cache even when current version is the latest version built. By default this is false and the policy cache will not be updated unless it is not the latest."
                }
            },
            "required":[
                "forceUpdate"
            ]
        },
        "CacheUpdateResponse":{
            "type":"object",
            "properties":{
                "updatedBy":{
                    "type":"string",
                    "description":"Reference of user that updated the policycache. In case its forceupdated, the REST username is used."
                },
                "updateTime":{
                    "type":"string",
                    "description":"The date time when the cache was last finised creation and written into the table."
                },
                "updatedOrCreated":{
                    "type":"boolean",
                    "description":"Whether the existing cache row is updated due to this REST API call or created."
                },
                "checkSum":{
                    "type":"string",
                    "description":"The hash value of the policy cache. Can be used for checking two versions of the policy cache."
                },
                "version":{
                    "type":"string",
                    "description":"version number of this policy cache. Used for updation logic for runtime and admin servers."
                },
                "message":{
                    "type":"string",
                    "description":"The return message for this operation. If the operation failed, the error message has the required details on what went wrong while performing the operation."
                }
            },
            "required":[
                "updatedBy",
                "updateTime",
                "checkSum",
                "version"
            ]
        }
    }
}