Skip to content

Commit

Permalink
[NO-ISSUE] Update Openapi.yml to 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Msarawan authored and gaohoward committed Oct 25, 2024
1 parent c8a5c47 commit 5226e42
Show file tree
Hide file tree
Showing 6 changed files with 481 additions and 3 deletions.
210 changes: 208 additions & 2 deletions api-server/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ info:
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
version: 1.0.0-alpha
version: 0.1.1
description: |
This document contains a list of currently avaliable apis that
This document contains a list of currently available apis that
can be used by the **activemq-artemis-self-provisioning plugin**
to get access to the [management api](https://github.com/apache/activemq-artemis/blob/main/docs/user-manual/management.adoc#the-management-api) of a broker instance via
its [jolokia](https://jolokia.org/) endpoint.
Expand Down Expand Up @@ -483,6 +483,118 @@ paths:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
/readClusterConnectionAttributes:
get:
summary: read cluster connection attributes
description: >
**Read values of cluster connection attributes**
The return value is a json array that contains
values of requested attributes of the cluster connection's mbean.
**Note**: to read multiple attributes, set it to **attrs** parameter
separated by commas, e.g. `NodeID, Topology`.
tags:
- jolokia
operationId: readClusterConnectionAttributes
parameters:
- in: header
name: jolokia-session-id
schema:
type: string
required: true
- name: name
description: the cluster connection name
schema:
type: string
required: true
in: query
- name: attrs
description: attribute names separated by commas. If not speified read all attributes.
required: false
in: query
schema:
type: array
items:
type: string
style: form
explode: false
responses:
200:
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ComponentAttribute'
401:
description: Invalid credentials
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
500:
description: Internal server error
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
/execClusterConnectionOperation:
post:
summary: execute a cluster connection operation
description: >
**Invoke an operation of the cluster connection mbean**
It receives a POST request where the body
should have the operation signature and its args.
The return value is a one element json array that contains
return values of invoked operation along with the request info.
tags:
- jolokia
operationId: execClusterConnectionOperation
parameters:
- in: header
name: jolokia-session-id
schema:
type: string
required: true
- in: query
name: name
schema:
type: string
required: true
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OperationRef'
responses:
200:
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ExecResult'
401:
description: Invalid credentials
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
500:
description: Internal server error
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'

/checkCredentials:
get:
summary: Check the validity of the credentials
Expand Down Expand Up @@ -875,6 +987,90 @@ paths:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
/clusterConnections:
get:
summary: list cluster connections
description: >
**Get all cluster connections in a broker**
It retrieves and returns a list of all cluster connection mbeans
tags:
- jolokia
operationId: getClusterConnections
parameters:
- in: header
name: jolokia-session-id
schema:
type: string
required: true
responses:
200:
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ClusterConnection'
401:
description: Invalid credentials
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
500:
description: Internal server error
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
/clusterConnectionDetails:
get:
summary: retrieve cluster connection details
description: >
**Get details of a connection cluster**
The return value is a json object that contains
description of all the operations and attributes of a `cluster connection` mbean.
It is defined in [ClusterConnectionControl.java](https://github.com/apache/activemq-artemis/blob/2.33.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ClusterConnectionControl.java)
tags:
- jolokia
operationId: getClusterConnectionDetails
parameters:
- in: header
name: jolokia-session-id
schema:
type: string
required: true
- name: name
required: true
in: query
schema:
type: string
description: the cluster connection name
responses:
200:
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ComponentDetails'
401:
description: Invalid credentials
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
500:
description: Internal server error
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/FailureResponse'
/api-info:
get:
summary: the api info
Expand Down Expand Up @@ -1035,6 +1231,16 @@ components:
type: string
broker:
$ref: '#/components/schemas/Broker'
ClusterConnection:
type: object
required:
- name
- broker
properties:
name:
type: string
broker:
$ref: '#/components/schemas/Broker'
Queue:
type: object
required:
Expand Down
126 changes: 126 additions & 0 deletions src/openapi/jolokia/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,72 @@ export const useJolokiaServiceReadAcceptorAttributes = <
() => JolokiaService.readAcceptorAttributes(jolokiaSessionId, name, attrs),
options,
);
export const useJolokiaServiceReadClusterConnectionAttributesKey =
'JolokiaServiceReadClusterConnectionAttributes';
export const useJolokiaServiceReadClusterConnectionAttributes = <
TQueryKey extends Array<unknown> = unknown[],
>(
{
jolokiaSessionId,
name,
attrs,
}: {
jolokiaSessionId: string;
name: string;
attrs?: Array<string>;
},
queryKey?: TQueryKey,
options?: Omit<
UseQueryOptions<
Awaited<
ReturnType<typeof JolokiaService.readClusterConnectionAttributes>
>,
unknown,
Awaited<
ReturnType<typeof JolokiaService.readClusterConnectionAttributes>
>,
unknown[]
>,
'queryKey' | 'queryFn' | 'initialData'
>,
) =>
useQuery(
[
useJolokiaServiceReadClusterConnectionAttributesKey,
...(queryKey ?? [{ jolokiaSessionId, name, attrs }]),
],
() =>
JolokiaService.readClusterConnectionAttributes(
jolokiaSessionId,
name,
attrs,
),
options,
);
export const useJolokiaServiceExecClusterConnectionOperation = (
options?: Omit<
UseMutationOptions<
Awaited<ReturnType<typeof JolokiaService.execClusterConnectionOperation>>,
unknown,
{
jolokiaSessionId: string;
name: string;
requestBody: OperationRef;
},
unknown
>,
'mutationFn'
>,
) =>
useMutation(
({ jolokiaSessionId, name, requestBody }) =>
JolokiaService.execClusterConnectionOperation(
jolokiaSessionId,
name,
requestBody,
),
options,
);
export const useJolokiaServiceCheckCredentialsKey =
'JolokiaServiceCheckCredentials';
export const useJolokiaServiceCheckCredentials = <
Expand Down Expand Up @@ -486,6 +552,66 @@ export const useJolokiaServiceGetAcceptorDetails = <
() => JolokiaService.getAcceptorDetails(jolokiaSessionId, name),
options,
);
export const useJolokiaServiceGetClusterConnectionsKey =
'JolokiaServiceGetClusterConnections';
export const useJolokiaServiceGetClusterConnections = <
TQueryKey extends Array<unknown> = unknown[],
>(
{
jolokiaSessionId,
}: {
jolokiaSessionId: string;
},
queryKey?: TQueryKey,
options?: Omit<
UseQueryOptions<
Awaited<ReturnType<typeof JolokiaService.getClusterConnections>>,
unknown,
Awaited<ReturnType<typeof JolokiaService.getClusterConnections>>,
unknown[]
>,
'queryKey' | 'queryFn' | 'initialData'
>,
) =>
useQuery(
[
useJolokiaServiceGetClusterConnectionsKey,
...(queryKey ?? [{ jolokiaSessionId }]),
],
() => JolokiaService.getClusterConnections(jolokiaSessionId),
options,
);
export const useJolokiaServiceGetClusterConnectionDetailsKey =
'JolokiaServiceGetClusterConnectionDetails';
export const useJolokiaServiceGetClusterConnectionDetails = <
TQueryKey extends Array<unknown> = unknown[],
>(
{
jolokiaSessionId,
name,
}: {
jolokiaSessionId: string;
name: string;
},
queryKey?: TQueryKey,
options?: Omit<
UseQueryOptions<
Awaited<ReturnType<typeof JolokiaService.getClusterConnectionDetails>>,
unknown,
Awaited<ReturnType<typeof JolokiaService.getClusterConnectionDetails>>,
unknown[]
>,
'queryKey' | 'queryFn' | 'initialData'
>,
) =>
useQuery(
[
useJolokiaServiceGetClusterConnectionDetailsKey,
...(queryKey ?? [{ jolokiaSessionId, name }]),
],
() => JolokiaService.getClusterConnectionDetails(jolokiaSessionId, name),
options,
);
export const useDevelopmentServiceApiInfoKey = 'DevelopmentServiceApiInfo';
export const useDevelopmentServiceApiInfo = <
TQueryKey extends Array<unknown> = unknown[],
Expand Down
2 changes: 1 addition & 1 deletion src/openapi/jolokia/requests/core/OpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type OpenAPIConfig = {

export const OpenAPI: OpenAPIConfig = {
BASE: '/api/v1',
VERSION: '1.0.0-alpha',
VERSION: '0.1.1',
WITH_CREDENTIALS: false,
CREDENTIALS: 'include',
TOKEN: undefined,
Expand Down
1 change: 1 addition & 0 deletions src/openapi/jolokia/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { ApiResponse } from './models/ApiResponse';
export type { Argument } from './models/Argument';
export type { Attr } from './models/Attr';
export type { Broker } from './models/Broker';
export type { ClusterConnection } from './models/ClusterConnection';
export type { ComponentAttribute } from './models/ComponentAttribute';
export type { ComponentDetails } from './models/ComponentDetails';
export { DummyResponse } from './models/DummyResponse';
Expand Down
Loading

0 comments on commit 5226e42

Please sign in to comment.