Skip to content

Commit

Permalink
better API names, remove repeating 'API'
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Oct 5, 2023
1 parent c61a2f2 commit 4bcd096
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 252 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ OPA exposes domain-agnostic APIs that your service can call to manage and enforc
The `OpenPolicyAgent.Client` module includes methods to help interact with the OPA server using the OpenAPI client.

```julia
opa_client = OpenPolicyAgent.Client.DataAPIApi(openapi_client)
opa_client = OpenPolicyAgent.Client.DataApi(openapi_client)

response, _http_resp = OpenPolicyAgent.Client.get_document(
opa_client,
Expand Down
48 changes: 24 additions & 24 deletions specs/openapi/open_policy_agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ servers:
- url: 'http://localhost:8181'
description: Local server on default port
tags:
- name: Policy API
- name: Policy
description: |-
The Policy API exposes CRUD endpoints for managing policy modules. Policy modules can be added, removed, and modified at any time.
The identifiers given to policy modules are only used for management purposes. They are not used outside of the Policy API.
- name: Data API
- name: Data
description: |-
Exposes endpoints for reading and writing documents in OPA.
For an explanation of the different types of documents, see [How Does OPA Work?](https://www.openpolicyagent.org/docs/latest/philosophy#how-does-opa-work)
- name: Query API
- name: Query
description: Posting queries to OPA
- name: Compile API
- name: Compile
description: Posting partial queries to OPA
- name: Health API
- name: Health
description: |-
Executes a simple built-in policy query to verify that the server is operational.
Optionally it can account for bundle activation as well (useful for "ready" checks at startup).
- name: Config API
- name: Config
description: |-
Returns OPA’s active configuration.
When the discovery feature is enabled, this API can be used to fetch the discovered configuration in the last evaluated discovery bundle.
The credentials field in the Services configuration and the private_key and key fields in the Keys configuration will be omitted from the API response.
- name: Status API
- name: Status
description: |-
Exposes a pull-based API for accessing OPA Status information.
Normally this information is pushed by OPA to a remote service via HTTP, console, or custom plugins.
Expand Down Expand Up @@ -63,7 +63,7 @@ paths:
OPA serves POST requests without a URL path by querying for the document at path `/data/system/main`.
The content of that document defines the response entirely.
tags:
- Query API
- Query
parameters:
- $ref: '#/components/parameters/prettyParameter'
requestBody:
Expand All @@ -89,7 +89,7 @@ paths:
description: |-
For queries that have large JSON values it is recommended to use the POST method with the query included as the POST body
tags:
- Query API
- Query
parameters:
- $ref: '#/components/parameters/prettyParameter'
- $ref: '#/components/parameters/explainParameter'
Expand Down Expand Up @@ -120,7 +120,7 @@ paths:
}
```
tags:
- Query API
- Query
parameters:
- $ref: '#/components/parameters/prettyParameter'
- $ref: '#/components/parameters/explainParameter'
Expand Down Expand Up @@ -154,7 +154,7 @@ paths:
The request message body defines the content of the The input Document. The request message body may be empty.
The path separator is used to access values inside object and array documents.
tags:
- Data API
- Data
operationId: getDocumentFromWebhook
parameters:
- $ref: '#/components/parameters/prettyParameter'
Expand Down Expand Up @@ -188,7 +188,7 @@ paths:
- The query requires an input document and you do not provide it
- You provide the input document but the query has already defined it.
tags:
- Data API
- Data
operationId: getDocument
parameters:
- $ref: '#/components/parameters/inputParameter'
Expand Down Expand Up @@ -218,7 +218,7 @@ paths:
- The query requires an input document and you do not provide it
- You provided an input document but the query has already defined it.
tags:
- Data API
- Data
operationId: getDocumentWithPath
parameters:
- $ref: '#/components/parameters/prettyParameter'
Expand Down Expand Up @@ -250,7 +250,7 @@ paths:
The server will respect the If-None-Match header if it is set to *.
In this case, the server will not overwrite an existing document located at the path.
tags:
- Data API
- Data
parameters:
- $ref: '#/components/parameters/metricsParameter'
requestBody:
Expand Down Expand Up @@ -281,7 +281,7 @@ paths:
description: |-
Update a document. The patch operation is specified in the request body.
tags:
- Data API
- Data
requestBody:
description: The patch operation in `application/json-patch+json` format
required: true
Expand All @@ -308,7 +308,7 @@ paths:
description: |-
The server processes the DELETE method as if the client had sent a PATCH request containing a single remove operation.
tags:
- Data API
- Data
parameters:
- $ref: '#/components/parameters/metricsParameter'
responses:
Expand All @@ -329,7 +329,7 @@ paths:
summary: List policies
description: This API endpoint responds with a list of all policy modules on the server (result response)
tags:
- Policy API
- Policy
operationId: getPolicies
parameters:
- $ref: '#/components/parameters/prettyParameter'
Expand Down Expand Up @@ -392,7 +392,7 @@ paths:
summary: Get a policy module
description: This API endpoint returns the details of the specified policy module (`{id}`)
tags:
- Policy API
- Policy
operationId: getPolicyModule
parameters:
- $ref: '#/components/parameters/prettyParameter'
Expand Down Expand Up @@ -452,7 +452,7 @@ paths:
networks[m].public == true
}
tags:
- Policy API
- Policy
responses:
'200':
$ref: '#/components/responses/putPolicySuccessResponse'
Expand All @@ -464,7 +464,7 @@ paths:
summary: Delete a policy module
description: This API endpoint removes an existing policy module from the server
tags:
- Policy API
- Policy
operationId: deletePolicyModule
parameters:
- $ref: '#/components/parameters/prettyParameter'
Expand Down Expand Up @@ -530,7 +530,7 @@ paths:
<br/>
See [the guidance](https://www.openpolicyagent.org/docs/latest/rest-api/#unconditional-results-from-partial-evaluation) for details.
tags:
- Compile API
- Compile
externalDocs:
description: Partial evaluation article
url: 'https://blog.openpolicyagent.org/partial-evaluation-162750eaf422'
Expand Down Expand Up @@ -565,7 +565,7 @@ paths:
parameters:
- $ref: '#/components/parameters/prettyParameter'
tags:
- Config API
- Config
responses:
'200':
$ref: '#/components/responses/getConfigSuccessResponse'
Expand All @@ -581,7 +581,7 @@ paths:
parameters:
- $ref: '#/components/parameters/prettyParameter'
tags:
- Status API
- Status
responses:
'200':
$ref: '#/components/responses/getStatusResponse'
Expand All @@ -605,7 +605,7 @@ paths:
---
tags:
- Health API
- Health
externalDocs:
description: Health API
url: 'https://www.openpolicyagent.org/docs/latest/rest-api/#health-api'
Expand Down
28 changes: 14 additions & 14 deletions src/client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.openapi-generator-ignore
README.md
docs/CompileAPIApi.md
docs/CompileApi.md
docs/CompileSuccessResponse.md
docs/ConfigAPIApi.md
docs/ConfigApi.md
docs/CreateDocumentSuccessResponse.md
docs/DataAPIApi.md
docs/DataApi.md
docs/DeleteDocumentSuccessResponse.md
docs/ErrorDetail.md
docs/ErrorLocation.md
docs/GetDocumentSuccessResponse.md
docs/GetPolicyListSuccessResponse.md
docs/GetPolicyModuleSuccessResponse.md
docs/HealthAPIApi.md
docs/HealthApi.md
docs/PartialQuerySchema.md
docs/PatchOperation.md
docs/Policy.md
docs/PolicyAPIApi.md
docs/PolicyApi.md
docs/PolicyAst.md
docs/PolicyAstPackage.md
docs/PolicyAstPackagePathInner.md
Expand All @@ -25,19 +25,19 @@ docs/PolicyAstRulesInnerHead.md
docs/PolicyAstRulesInnerHeadKey.md
docs/Provenance.md
docs/PutPolicySuccessResponse.md
docs/QueryAPIApi.md
docs/QueryApi.md
docs/QueryParameterPost.md
docs/ServerErrorResponse.md
docs/StatusAPIApi.md
docs/StatusApi.md
docs/UnhealthyResponse.md
src/Client.jl
src/apis/api_CompileAPIApi.jl
src/apis/api_ConfigAPIApi.jl
src/apis/api_DataAPIApi.jl
src/apis/api_HealthAPIApi.jl
src/apis/api_PolicyAPIApi.jl
src/apis/api_QueryAPIApi.jl
src/apis/api_StatusAPIApi.jl
src/apis/api_CompileApi.jl
src/apis/api_ConfigApi.jl
src/apis/api_DataApi.jl
src/apis/api_HealthApi.jl
src/apis/api_PolicyApi.jl
src/apis/api_QueryApi.jl
src/apis/api_StatusApi.jl
src/modelincludes.jl
src/models/model_CompileSuccessResponse.jl
src/models/model_CreateDocumentSuccessResponse.jl
Expand Down
34 changes: 17 additions & 17 deletions src/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ Documentation is also embedded in Julia which can be used with a Julia specific

Class | Method
------------ | -------------
*CompileAPIApi* | [**post_compile**](docs/CompileAPIApi.md#post_compile)<br/>**POST** /v1/compile<br/>Partially evaluate a query.
*ConfigAPIApi* | [**get_config**](docs/ConfigAPIApi.md#get_config)<br/>**GET** /v1/config<br/>Get configurations
*DataAPIApi* | [**create_document**](docs/DataAPIApi.md#create_document)<br/>**PUT** /v1/data/{path}<br/>Create or overwrite a document.
*DataAPIApi* | [**delete_document**](docs/DataAPIApi.md#delete_document)<br/>**DELETE** /v1/data/{path}<br/>Delete a document
*DataAPIApi* | [**get_document**](docs/DataAPIApi.md#get_document)<br/>**GET** /v1/data/{path}<br/>Get a document
*DataAPIApi* | [**get_document_from_webhook**](docs/DataAPIApi.md#get_document_from_webhook)<br/>**POST** /v0/data/{path}<br/>Get a document from a webhook.
*DataAPIApi* | [**get_document_with_path**](docs/DataAPIApi.md#get_document_with_path)<br/>**POST** /v1/data/{path}<br/>Get a document that required an input
*DataAPIApi* | [**patch_document**](docs/DataAPIApi.md#patch_document)<br/>**PATCH** /v1/data/{path}<br/>Patch a document
*HealthAPIApi* | [**get_health**](docs/HealthAPIApi.md#get_health)<br/>**GET** /health<br/>Health
*PolicyAPIApi* | [**delete_policy_module**](docs/PolicyAPIApi.md#delete_policy_module)<br/>**DELETE** /v1/policies/{id}<br/>Delete a policy module
*PolicyAPIApi* | [**get_policies**](docs/PolicyAPIApi.md#get_policies)<br/>**GET** /v1/policies<br/>List policies
*PolicyAPIApi* | [**get_policy_module**](docs/PolicyAPIApi.md#get_policy_module)<br/>**GET** /v1/policies/{id}<br/>Get a policy module
*PolicyAPIApi* | [**put_policy_module**](docs/PolicyAPIApi.md#put_policy_module)<br/>**PUT** /v1/policies/{id}<br/>Create or update a policy module
*QueryAPIApi* | [**query_get**](docs/QueryAPIApi.md#query_get)<br/>**GET** /v1/query<br/>Execute an ad-hoc query and return bindings for variables found in the query.
*QueryAPIApi* | [**query_post**](docs/QueryAPIApi.md#query_post)<br/>**POST** /v1/query<br/>Execute an ad-hoc query and return bindings for variables found in the query.
*QueryAPIApi* | [**simple_query**](docs/QueryAPIApi.md#simple_query)<br/>**POST** /<br/>Execute a simple query.
*StatusAPIApi* | [**get_status**](docs/StatusAPIApi.md#get_status)<br/>**GET** /v1/status<br/>Get status
*CompileApi* | [**post_compile**](docs/CompileApi.md#post_compile)<br/>**POST** /v1/compile<br/>Partially evaluate a query.
*ConfigApi* | [**get_config**](docs/ConfigApi.md#get_config)<br/>**GET** /v1/config<br/>Get configurations
*DataApi* | [**create_document**](docs/DataApi.md#create_document)<br/>**PUT** /v1/data/{path}<br/>Create or overwrite a document.
*DataApi* | [**delete_document**](docs/DataApi.md#delete_document)<br/>**DELETE** /v1/data/{path}<br/>Delete a document
*DataApi* | [**get_document**](docs/DataApi.md#get_document)<br/>**GET** /v1/data/{path}<br/>Get a document
*DataApi* | [**get_document_from_webhook**](docs/DataApi.md#get_document_from_webhook)<br/>**POST** /v0/data/{path}<br/>Get a document from a webhook.
*DataApi* | [**get_document_with_path**](docs/DataApi.md#get_document_with_path)<br/>**POST** /v1/data/{path}<br/>Get a document that required an input
*DataApi* | [**patch_document**](docs/DataApi.md#patch_document)<br/>**PATCH** /v1/data/{path}<br/>Patch a document
*HealthApi* | [**get_health**](docs/HealthApi.md#get_health)<br/>**GET** /health<br/>Health
*PolicyApi* | [**delete_policy_module**](docs/PolicyApi.md#delete_policy_module)<br/>**DELETE** /v1/policies/{id}<br/>Delete a policy module
*PolicyApi* | [**get_policies**](docs/PolicyApi.md#get_policies)<br/>**GET** /v1/policies<br/>List policies
*PolicyApi* | [**get_policy_module**](docs/PolicyApi.md#get_policy_module)<br/>**GET** /v1/policies/{id}<br/>Get a policy module
*PolicyApi* | [**put_policy_module**](docs/PolicyApi.md#put_policy_module)<br/>**PUT** /v1/policies/{id}<br/>Create or update a policy module
*QueryApi* | [**query_get**](docs/QueryApi.md#query_get)<br/>**GET** /v1/query<br/>Execute an ad-hoc query and return bindings for variables found in the query.
*QueryApi* | [**query_post**](docs/QueryApi.md#query_post)<br/>**POST** /v1/query<br/>Execute an ad-hoc query and return bindings for variables found in the query.
*QueryApi* | [**simple_query**](docs/QueryApi.md#simple_query)<br/>**POST** /<br/>Execute a simple query.
*StatusApi* | [**get_status**](docs/StatusApi.md#get_status)<br/>**GET** /v1/status<br/>Get status


## Models
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# CompileAPIApi
# CompileApi

All URIs are relative to *http://localhost:8181*

Method | HTTP request | Description
------------- | ------------- | -------------
[**post_compile**](CompileAPIApi.md#post_compile) | **POST** /v1/compile | Partially evaluate a query.
[**post_compile**](CompileApi.md#post_compile) | **POST** /v1/compile | Partially evaluate a query.


# **post_compile**
> post_compile(_api::CompileAPIApi; pretty=nothing, explain=nothing, metrics=nothing, instrument=nothing, partial_query_schema=nothing, _mediaType=nothing) -> CompileSuccessResponse, OpenAPI.Clients.ApiResponse <br/>
> post_compile(_api::CompileAPIApi, response_stream::Channel; pretty=nothing, explain=nothing, metrics=nothing, instrument=nothing, partial_query_schema=nothing, _mediaType=nothing) -> Channel{ CompileSuccessResponse }, OpenAPI.Clients.ApiResponse
> post_compile(_api::CompileApi; pretty=nothing, explain=nothing, metrics=nothing, instrument=nothing, partial_query_schema=nothing, _mediaType=nothing) -> CompileSuccessResponse, OpenAPI.Clients.ApiResponse <br/>
> post_compile(_api::CompileApi, response_stream::Channel; pretty=nothing, explain=nothing, metrics=nothing, instrument=nothing, partial_query_schema=nothing, _mediaType=nothing) -> Channel{ CompileSuccessResponse }, OpenAPI.Clients.ApiResponse
Partially evaluate a query.

Expand All @@ -19,7 +19,7 @@ The Compile API allows you to partially evaluate Rego queries and obtain a simpl

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**_api** | **CompileAPIApi** | API context |
**_api** | **CompileApi** | API context |

### Optional Parameters

Expand Down
10 changes: 5 additions & 5 deletions src/client/docs/ConfigAPIApi.md → src/client/docs/ConfigApi.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# ConfigAPIApi
# ConfigApi

All URIs are relative to *http://localhost:8181*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_config**](ConfigAPIApi.md#get_config) | **GET** /v1/config | Get configurations
[**get_config**](ConfigApi.md#get_config) | **GET** /v1/config | Get configurations


# **get_config**
> get_config(_api::ConfigAPIApi; pretty=nothing, _mediaType=nothing) -> Dict{String, Any}, OpenAPI.Clients.ApiResponse <br/>
> get_config(_api::ConfigAPIApi, response_stream::Channel; pretty=nothing, _mediaType=nothing) -> Channel{ Dict{String, Any} }, OpenAPI.Clients.ApiResponse
> get_config(_api::ConfigApi; pretty=nothing, _mediaType=nothing) -> Dict{String, Any}, OpenAPI.Clients.ApiResponse <br/>
> get_config(_api::ConfigApi, response_stream::Channel; pretty=nothing, _mediaType=nothing) -> Channel{ Dict{String, Any} }, OpenAPI.Clients.ApiResponse
Get configurations

Expand All @@ -19,7 +19,7 @@ The /config API endpoint returns OPA's active configuration. When the discovery

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**_api** | **ConfigAPIApi** | API context |
**_api** | **ConfigApi** | API context |

### Optional Parameters

Expand Down
Loading

0 comments on commit 4bcd096

Please sign in to comment.