-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release' into 'master'
RELEASE 2.3.0 See merge request arenadata/development/adcm!4038
- Loading branch information
Showing
163 changed files
with
5,888 additions
and
2,330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,7 @@ | |
"refractor", | ||
"rp", | ||
"req", | ||
"runnable", | ||
"schemas", | ||
"searchable", | ||
"sql", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
152
adcm-web/app/src/api/adcm/clusterServiceActionHostGroups.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}/`, | ||
); | ||
} | ||
} |
Oops, something went wrong.