Skip to content

Commit

Permalink
Merge branch 'release' into 'master'
Browse files Browse the repository at this point in the history
RELEASE 2.3.0

See merge request arenadata/development/adcm!4038
  • Loading branch information
a-alferov committed Sep 5, 2024
2 parents 9c8aab4 + 14f4a4b commit 7a1db76
Show file tree
Hide file tree
Showing 163 changed files with 5,888 additions and 2,330 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APP_IMAGE ?= hub.adsw.io/adcm/adcm
APP_TAG ?= $(subst /,_,$(BRANCH_NAME))
SELENOID_HOST ?= 10.92.2.65
SELENOID_PORT ?= 4444
ADCM_VERSION = "2.2.0"
ADCM_VERSION = "2.3.0"
PY_FILES = python dev/linters conf/adcm/python_scripts

.PHONY: help
Expand Down
1 change: 1 addition & 0 deletions adcm-web/app/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"refractor",
"rp",
"req",
"runnable",
"schemas",
"searchable",
"sql",
Expand Down
15 changes: 15 additions & 0 deletions adcm-web/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ import ServiceComponentConfigGroupSingle from '@pages/cluster/service/component/
import HostProviderConfigurationGroupSingle from '@pages/HostProviderPage/HostProviderConfigurationGroupSingle/HostProviderConfigurationGroupSingle';
import NotFoundPage from '@pages/NotFoundPage/NotFoundPage';
import ClusterAnsibleSettings from '@pages/cluster/ClusterConfiguration/ClusterAnsibleSettings/ClusterAnsibleSettings';
import ClusterActionHostGroups from '@pages/cluster/ClusterConfiguration/ClusterActionHostGroups/ClusterActionHostGroups';
import ServiceActionHostGroups from '@pages/cluster/service/ServiceActionHostGroups/ServiceActionHostGroups';
import ComponentActionHostGroups from '@pages/cluster/service/component/ComponentActionHostGroups/ComponentActionHostGroups';

function App() {
return (
Expand Down Expand Up @@ -107,6 +110,10 @@ function App() {
path="/clusters/:clusterId/services/:serviceId/configuration-groups/:configGroupId/"
element={<ServiceConfigGroupSingle />}
/>
<Route
path="/clusters/:clusterId/services/:serviceId/action-host-groups"
element={<ServiceActionHostGroups />}
/>
<Route
path="/clusters/:clusterId/services/:serviceId/components"
element={<ServiceComponents />}
Expand All @@ -124,6 +131,10 @@ function App() {
path="/clusters/:clusterId/services/:serviceId/components/:componentId/configuration-groups"
element={<ServiceComponentConfigurationGroups />}
/>
<Route
path="/clusters/:clusterId/services/:serviceId/components/:componentId/action-host-groups"
element={<ComponentActionHostGroups />}
/>
<Route
path="/clusters/:clusterId/services/:serviceId/components/:componentId/configuration-groups/:configGroupId"
element={<ServiceComponentConfigGroupSingle />}
Expand Down Expand Up @@ -161,6 +172,10 @@ function App() {
path="/clusters/:clusterId/configuration/ansible-settings"
element={<ClusterAnsibleSettings />}
/>
<Route
path="/clusters/:clusterId/configuration/action-host-groups"
element={<ClusterActionHostGroups />}
/>
</Route>
<Route path="/clusters/:clusterId/import" element={<ClusterImport />}>
<Route index element={<Navigate to="cluster" replace />} />
Expand Down
148 changes: 148 additions & 0 deletions adcm-web/app/src/api/adcm/clusterActionHostGroups.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import { httpClient } from '@api/httpClient';
import type { AdcmDynamicAction, AdcmDynamicActionDetails, AdcmJob, Batch } from '@models/adcm';
import type {
AdcmActionHostGroup,
GetAdcmClusterActionHostGroupsArgs,
GetAdcmClusterActionHostGroupArgs,
CreateAdcmClusterActionHostGroupArgs,
DeleteAdcmClusterActionHostGroupArgs,
GetAdcmClusterActionHostGroupActionsArgs,
GetAdcmClusterActionHostGroupActionArgs,
RunAdcmClusterActionHostGroupActionArgs,
AdcmActionHostGroupHost,
GetAdcmClusterActionHostGroupsHostCandidatesArgs,
GetAdcmClusterActionHostGroupHostCandidatesArgs,
GetAdcmClusterActionHostGroupHostsArgs,
AddAdcmClusterActionHostGroupHostArgs,
DeleteAdcmClusterActionHostGroupHostArgs,
} from '@models/adcm/actionHostGroup';
import { prepareQueryParams } from '@utils/apiUtils';
import qs from 'qs';

export class AdcmClusterActionHostGroupsApi {
// CRUD

public static async getActionHostGroups(args: GetAdcmClusterActionHostGroupsArgs) {
const { clusterId, filter, paginationParams } = args;
const queryParams = prepareQueryParams(filter, undefined, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<Batch<AdcmActionHostGroup>>(
`/api/v2/clusters/${clusterId}/action-host-groups/?${query}`,
);

return response.data;
}

public static async getActionHostGroup(args: GetAdcmClusterActionHostGroupArgs) {
const { clusterId, actionHostGroupId } = args;
const response = await httpClient.get<AdcmActionHostGroup>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/`,
);

return response.data;
}

public static async postActionHostGroup(args: CreateAdcmClusterActionHostGroupArgs) {
const { clusterId, actionHostGroup } = args;
const response = await httpClient.post<AdcmActionHostGroup>(
`/api/v2/clusters/${clusterId}/action-host-groups/`,
actionHostGroup,
);

return response.data;
}

public static async deleteActionHostGroup(args: DeleteAdcmClusterActionHostGroupArgs) {
const { clusterId, actionHostGroupId } = args;
await httpClient.delete(`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/`);
}

// Actions

public static async getActionHostGroupActions(args: GetAdcmClusterActionHostGroupActionsArgs) {
const { clusterId, actionHostGroupId, sortParams, filter, paginationParams } = args;
const queryParams = prepareQueryParams(filter, sortParams, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmDynamicAction[]>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/actions/?${query}`,
);

return response.data;
}

public static async getActionHostGroupAction(args: GetAdcmClusterActionHostGroupActionArgs) {
const { clusterId, actionHostGroupId, actionId } = args;
const response = await httpClient.get<AdcmDynamicActionDetails>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/actions/${actionId}/`,
);

return response.data;
}

public static async postActionHostGroupAction(args: RunAdcmClusterActionHostGroupActionArgs) {
const { clusterId, actionHostGroupId, actionId, actionRunConfig } = args;
const response = await httpClient.post<AdcmJob>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/actions/${actionId}/run/`,
actionRunConfig,
);

return response.data;
}

// Host candidates

public static async getActionHostGroupsHostCandidates(args: GetAdcmClusterActionHostGroupsHostCandidatesArgs) {
const { clusterId, filter } = args;
const queryParams = prepareQueryParams(filter);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmActionHostGroupHost[]>(
`/api/v2/clusters/${clusterId}/action-host-groups/host-candidates/?${query}`,
);

return response.data;
}

public static async getActionHostGroupHostCandidates(args: GetAdcmClusterActionHostGroupHostCandidatesArgs) {
const { clusterId, actionHostGroupId, filter } = args;
const queryParams = prepareQueryParams(filter);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmActionHostGroupHost[]>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/host-candidates/?${query}`,
);

return response.data;
}

// Hosts

public static async getActionHostGroupHosts(args: GetAdcmClusterActionHostGroupHostsArgs) {
const { clusterId, actionHostGroupId, sortParams, paginationParams } = args;
const queryParams = prepareQueryParams(undefined, sortParams, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<Batch<AdcmActionHostGroupHost>>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/hosts/?${query}`,
);

return response.data;
}

public static async postActionHostGroupHost(args: AddAdcmClusterActionHostGroupHostArgs) {
const { clusterId, actionHostGroupId, hostId } = args;
const response = await httpClient.post<AdcmActionHostGroupHost>(
`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/hosts/`,
{ hostId },
);

return response.data;
}

public static async deleteActionHostGroupHost(args: DeleteAdcmClusterActionHostGroupHostArgs) {
const { clusterId, actionHostGroupId, hostId } = args;
await httpClient.delete(`/api/v2/clusters/${clusterId}/action-host-groups/${actionHostGroupId}/hosts/${hostId}/`);
}
}
152 changes: 152 additions & 0 deletions adcm-web/app/src/api/adcm/clusterServiceActionHostGroups.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import { httpClient } from '@api/httpClient';
import type { AdcmDynamicAction, AdcmDynamicActionDetails, AdcmJob, Batch } from '@models/adcm';
import type {
AdcmActionHostGroup,
GetAdcmServiceActionHostGroupsArgs,
GetAdcmServiceActionHostGroupArgs,
CreateAdcmServiceActionHostGroupArgs,
DeleteAdcmServiceActionHostGroupArgs,
GetAdcmServiceActionHostGroupActionsArgs,
GetAdcmServiceActionHostGroupActionArgs,
RunAdcmServiceActionHostGroupActionArgs,
GetAdcmServiceActionHostGroupsHostCandidatesArgs,
AdcmActionHostGroupHost,
GetAdcmServiceActionHostGroupHostCandidatesArgs,
GetAdcmServiceActionHostGroupHostsArgs,
AddAdcmServiceActionHostGroupHostArgs,
DeleteAdcmServiceActionHostGroupHostArgs,
} from '@models/adcm/actionHostGroup';
import { prepareQueryParams } from '@utils/apiUtils';
import qs from 'qs';

export class AdcmClusterServiceActionHostGroupsApi {
// CRUD

public static async getActionHostGroups(args: GetAdcmServiceActionHostGroupsArgs) {
const { clusterId, serviceId, filter, paginationParams } = args;
const queryParams = prepareQueryParams(filter, undefined, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<Batch<AdcmActionHostGroup>>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/?${query}`,
);

return response.data;
}

public static async getActionHostGroup(args: GetAdcmServiceActionHostGroupArgs) {
const { clusterId, serviceId, actionHostGroupId } = args;
const response = await httpClient.get<AdcmActionHostGroup>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/`,
);

return response.data;
}

public static async postActionHostGroup(args: CreateAdcmServiceActionHostGroupArgs) {
const { clusterId, serviceId, actionHostGroup } = args;
const response = await httpClient.post<AdcmActionHostGroup>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/`,
actionHostGroup,
);

return response.data;
}

public static async deleteActionHostGroup(args: DeleteAdcmServiceActionHostGroupArgs) {
const { clusterId, serviceId, actionHostGroupId } = args;
await httpClient.delete(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/`,
);
}

// Actions

public static async getActionHostGroupActions(args: GetAdcmServiceActionHostGroupActionsArgs) {
const { clusterId, serviceId, actionHostGroupId, sortParams, filter, paginationParams } = args;
const queryParams = prepareQueryParams(filter, sortParams, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmDynamicAction[]>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/actions/?${query}`,
);

return response.data;
}

public static async getActionHostGroupAction(args: GetAdcmServiceActionHostGroupActionArgs) {
const { clusterId, serviceId, actionHostGroupId, actionId } = args;
const response = await httpClient.get<AdcmDynamicActionDetails>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/actions/${actionId}/`,
);

return response.data;
}

public static async postActionHostGroupAction(args: RunAdcmServiceActionHostGroupActionArgs) {
const { clusterId, serviceId, actionHostGroupId, actionId, actionRunConfig } = args;
const response = await httpClient.post<AdcmJob>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/actions/${actionId}/run/`,
actionRunConfig,
);

return response.data;
}

// Host candidates

public static async getActionHostGroupsHostCandidates(args: GetAdcmServiceActionHostGroupsHostCandidatesArgs) {
const { clusterId, serviceId, filter } = args;
const queryParams = prepareQueryParams(filter);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmActionHostGroupHost[]>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/host-candidates/?${query}`,
);

return response.data;
}

public static async getActionHostGroupHostCandidates(args: GetAdcmServiceActionHostGroupHostCandidatesArgs) {
const { clusterId, serviceId, actionHostGroupId, filter } = args;
const queryParams = prepareQueryParams(filter);
const query = qs.stringify(queryParams);

const response = await httpClient.get<AdcmActionHostGroupHost[]>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/host-candidates/?${query}`,
);

return response.data;
}

// Hosts

public static async getActionHostGroupHosts(args: GetAdcmServiceActionHostGroupHostsArgs) {
const { clusterId, serviceId, actionHostGroupId, sortParams, paginationParams } = args;
const queryParams = prepareQueryParams(undefined, sortParams, paginationParams);
const query = qs.stringify(queryParams);

const response = await httpClient.get<Batch<AdcmActionHostGroupHost>>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/hosts/?${query}`,
);

return response.data;
}

public static async postActionHostGroupHost(args: AddAdcmServiceActionHostGroupHostArgs) {
const { clusterId, serviceId, actionHostGroupId, hostId } = args;
const response = await httpClient.post<AdcmActionHostGroupHost>(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/hosts/`,
{ hostId },
);

return response.data;
}

public static async deleteActionHostGroupHost(args: DeleteAdcmServiceActionHostGroupHostArgs) {
const { clusterId, serviceId, actionHostGroupId, hostId } = args;
await httpClient.delete(
`/api/v2/clusters/${clusterId}/services/${serviceId}/action-host-groups/${actionHostGroupId}/hosts/${hostId}/`,
);
}
}
Loading

0 comments on commit 7a1db76

Please sign in to comment.