From ed84bc61bab01abccd79e2a519e7b3316fd439b0 Mon Sep 17 00:00:00 2001 From: Johanna Szepanski <johanna.szepanski@softhouse.se> Date: Mon, 26 Aug 2024 14:17:09 +0200 Subject: [PATCH] generated api based on swagger --- .eslintignore | 1 + src/store/deployApi.ts | 1184 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1185 insertions(+) create mode 100644 .eslintignore create mode 100644 src/store/deployApi.ts diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..e4978b77 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/store/deployApi.ts diff --git a/src/store/deployApi.ts b/src/store/deployApi.ts new file mode 100644 index 00000000..209faf44 --- /dev/null +++ b/src/store/deployApi.ts @@ -0,0 +1,1184 @@ +import { emptySplitApi as api } from "./emptyApi"; +const injectedRtkApi = api.injectEndpoints({ + endpoints: (build) => ({ + setMaintenanceMode: build.mutation< + SetMaintenanceModeApiResponse, + SetMaintenanceModeApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/maintenance_mode`, + method: "PUT", + body: queryArg.setMaintenance + }) + }), + getCurrentMode: build.query< + GetCurrentModeApiResponse, + GetCurrentModeApiArg + >({ + query: () => ({ url: `/api/v1/maintenance_mode/current` }) + }), + endCurrentMaintenanceMode: build.mutation< + EndCurrentMaintenanceModeApiResponse, + EndCurrentMaintenanceModeApiArg + >({ + query: () => ({ url: `/api/v1/maintenance_mode/current`, method: "PUT" }) + }), + listIocs: build.query<ListIocsApiResponse, ListIocsApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/iocs`, + params: { + deployment_status: queryArg.deploymentStatus, + created_by: queryArg.createdBy, + network: queryArg.network, + network_scope: queryArg.networkScope, + host_type: queryArg.hostType, + host_name: queryArg.hostName, + query: queryArg.query, + order_by: queryArg.orderBy, + order_asc: queryArg.orderAsc, + page: queryArg.page, + limit: queryArg.limit, + list_all: queryArg.listAll + } + }) + }), + createIoc: build.mutation<CreateIocApiResponse, CreateIocApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/iocs`, + method: "POST", + body: queryArg.createIoc + }) + }), + startOperation: build.mutation< + StartOperationApiResponse, + StartOperationApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}/operation`, + method: "POST", + body: queryArg.createJobRequest + }) + }), + updateJob: build.mutation<UpdateJobApiResponse, UpdateJobApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/awx/jobs`, + method: "POST", + body: queryArg.awxJobMeta + }) + }), + tokenRenew: build.mutation<TokenRenewApiResponse, TokenRenewApiArg>({ + query: () => ({ url: `/api/v1/authentication/renew`, method: "POST" }) + }), + login: build.mutation<LoginApiResponse, LoginApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/authentication/login`, + method: "POST", + body: queryArg.login + }) + }), + getIoc: build.query<GetIocApiResponse, GetIocApiArg>({ + query: (queryArg) => ({ url: `/api/v1/iocs/${queryArg.iocId}` }) + }), + deleteIoc: build.mutation<DeleteIocApiResponse, DeleteIocApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}`, + method: "DELETE" + }) + }), + updateIoc: build.mutation<UpdateIocApiResponse, UpdateIocApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}`, + method: "PATCH", + body: queryArg.iocUpdateRequest + }) + }), + unDeployInDb: build.mutation<UnDeployInDbApiResponse, UnDeployInDbApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}/undeploy_in_db`, + method: "PATCH" + }) + }), + updateActiveDeploymentHost: build.mutation< + UpdateActiveDeploymentHostApiResponse, + UpdateActiveDeploymentHostApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}/active_deployment/host`, + method: "PATCH", + body: queryArg.updateHostRequest + }) + }), + getHealthCheck: build.query< + GetHealthCheckApiResponse, + GetHealthCheckApiArg + >({ + query: () => ({ url: `/healthcheck` }) + }), + calculateStatistics: build.query< + CalculateStatisticsApiResponse, + CalculateStatisticsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/statistics/general/${queryArg.statisticsType}` + }) + }), + operationHistory: build.query< + OperationHistoryApiResponse, + OperationHistoryApiArg + >({ + query: () => ({ url: `/api/v1/statistics/general/operation_history` }) + }), + currentlyActiveIocs: build.query< + CurrentlyActiveIocsApiResponse, + CurrentlyActiveIocsApiArg + >({ + query: () => ({ url: `/api/v1/statistics/general/active_ioc_statistics` }) + }), + activeIocHistory: build.query< + ActiveIocHistoryApiResponse, + ActiveIocHistoryApiArg + >({ + query: () => ({ url: `/api/v1/statistics/general/active_ioc_history` }) + }), + findAllRecords: build.query< + FindAllRecordsApiResponse, + FindAllRecordsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/records`, + params: { + text: queryArg.text, + ioc_name: queryArg.iocName, + pv_status: queryArg.pvStatus, + page: queryArg.page, + limit: queryArg.limit + } + }) + }), + getRecord: build.query<GetRecordApiResponse, GetRecordApiArg>({ + query: (queryArg) => ({ url: `/api/v1/records/${queryArg.name}` }) + }), + fetchDeployment: build.query< + FetchDeploymentApiResponse, + FetchDeploymentApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/operations/${queryArg.deploymentId}` + }) + }), + listOperations: build.query< + ListOperationsApiResponse, + ListOperationsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/operations/operations`, + params: { + ioc_id: queryArg.iocId, + type: queryArg["type"], + status: queryArg.status, + user: queryArg.user, + query: queryArg.query, + start_date: queryArg.startDate, + end_date: queryArg.endDate, + time_zone: queryArg.timeZone, + host_id: queryArg.hostId, + order_by: queryArg.orderBy, + order_asc: queryArg.orderAsc, + page: queryArg.page, + limit: queryArg.limit + } + }) + }), + fetchOperation: build.query< + FetchOperationApiResponse, + FetchOperationApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/operations/operations/${queryArg.operationId}` + }) + }), + fetchJobDetails: build.query< + FetchJobDetailsApiResponse, + FetchJobDetailsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/operations/operations/job/${queryArg.jobId}` + }) + }), + fetchDeploymentJobLog: build.query< + FetchDeploymentJobLogApiResponse, + FetchDeploymentJobLogApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/operations/jobs/${queryArg.jobId}/log` + }) + }), + fetchIocByName: build.query< + FetchIocByNameApiResponse, + FetchIocByNameApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/names/ioc_names_by_name`, + params: { ioc_name: queryArg.iocName } + }) + }), + checkNamingUuId: build.query< + CheckNamingUuIdApiResponse, + CheckNamingUuIdApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/names/check_naming_uuid/${queryArg.namingUuid}` + }) + }), + fetchIocStatus: build.query< + FetchIocStatusApiResponse, + FetchIocStatusApiArg + >({ + query: (queryArg) => ({ url: `/api/v1/iocs/${queryArg.iocId}/status` }) + }), + getIocDescription: build.query< + GetIocDescriptionApiResponse, + GetIocDescriptionApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.iocId}/description` + }) + }), + fetchIocAlerts: build.query< + FetchIocAlertsApiResponse, + FetchIocAlertsApiArg + >({ + query: (queryArg) => ({ url: `/api/v1/iocs/${queryArg.iocId}/alerts` }) + }), + fetchProcServLogLines: build.query< + FetchProcServLogLinesApiResponse, + FetchProcServLogLinesApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/iocs/${queryArg.hostName}/${queryArg.iocName}/log`, + params: { time_range: queryArg.timeRange } + }) + }), + checkGitRepoId: build.query< + CheckGitRepoIdApiResponse, + CheckGitRepoIdApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/iocs/check_git_repo_id/${queryArg.repoId}` + }) + }), + listHosts: build.query<ListHostsApiResponse, ListHostsApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/hosts`, + params: { + text: queryArg.text, + filter: queryArg.filter, + page: queryArg.page, + limit: queryArg.limit, + list_all: queryArg.listAll + } + }) + }), + fetchSyslogLines: build.query< + FetchSyslogLinesApiResponse, + FetchSyslogLinesApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/hosts/${queryArg.hostName}/log`, + params: { time_range: queryArg.timeRange } + }) + }), + findHostStatus: build.query< + FindHostStatusApiResponse, + FindHostStatusApiArg + >({ + query: (queryArg) => ({ url: `/api/v1/hosts/${queryArg.hostId}/status` }) + }), + findAssociatedIocsByHostId: build.query< + FindAssociatedIocsByHostIdApiResponse, + FindAssociatedIocsByHostIdApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/hosts/${queryArg.hostId}/iocs`, + params: { + ioc_name: queryArg.iocName, + order_by: queryArg.orderBy, + order_asc: queryArg.orderAsc, + page: queryArg.page, + limit: queryArg.limit + } + }) + }), + findNetBoxHostByHostId: build.query< + FindNetBoxHostByHostIdApiResponse, + FindNetBoxHostByHostIdApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/hosts/${queryArg.hostId}/info_by_host_id` + }) + }), + findHostAlerts: build.query< + FindHostAlertsApiResponse, + FindHostAlertsApiArg + >({ + query: (queryArg) => ({ url: `/api/v1/hosts/${queryArg.hostId}/alerts` }) + }), + findNetBoxHostByFqdn: build.query< + FindNetBoxHostByFqdnApiResponse, + FindNetBoxHostByFqdnApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/hosts/${queryArg.fqdn}/info_by_fqdn` + }) + }), + listTagsAndCommitIds: build.query< + ListTagsAndCommitIdsApiResponse, + ListTagsAndCommitIdsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/git_helper/${queryArg.projectId}/tags_and_commits`, + params: { + reference: queryArg.reference, + search_method: queryArg.searchMethod + } + }) + }), + gitReferenceType: build.query< + GitReferenceTypeApiResponse, + GitReferenceTypeApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/git_helper/${queryArg.projectId}/reference_type/${queryArg.gitReference}` + }) + }), + infoFromUserName: build.query< + InfoFromUserNameApiResponse, + InfoFromUserNameApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/git_helper/user_info`, + params: { user_name: queryArg.userName } + }) + }), + listProjects: build.query<ListProjectsApiResponse, ListProjectsApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/git_helper/projects`, + params: { query: queryArg.query } + }) + }), + gitProjectDetails: build.query< + GitProjectDetailsApiResponse, + GitProjectDetailsApiArg + >({ + query: (queryArg) => ({ + url: `/api/v1/git_helper/project_info/${queryArg.projectId}` + }) + }), + getToolUsers: build.query<GetToolUsersApiResponse, GetToolUsersApiArg>({ + query: (queryArg) => ({ + url: `/api/v1/authentication/users`, + params: { query: queryArg.query } + }) + }), + getUserRoles: build.query<GetUserRolesApiResponse, GetUserRolesApiArg>({ + query: () => ({ url: `/api/v1/authentication/roles` }) + }), + logout: build.mutation<LogoutApiResponse, LogoutApiArg>({ + query: () => ({ url: `/api/v1/authentication/logout`, method: "DELETE" }) + }) + }), + overrideExisting: false +}); +export { injectedRtkApi as deployApi }; +export type SetMaintenanceModeApiResponse = + /** status 201 Maintenance Mode Changed */ MaintenanceMode; +export type SetMaintenanceModeApiArg = { + setMaintenance: SetMaintenance; +}; +export type GetCurrentModeApiResponse = + /** status 200 Found Mode */ MaintenanceMode; +export type GetCurrentModeApiArg = void; +export type EndCurrentMaintenanceModeApiResponse = + /** status 201 Maintenance Mode Changed */ MaintenanceMode; +export type EndCurrentMaintenanceModeApiArg = void; +export type ListIocsApiResponse = + /** status 200 A paged array of IOCs */ PagedIocResponse; +export type ListIocsApiArg = { + /** IOC's current deployment status */ + deploymentStatus?: "ALL" | "DEPLOYED" | "NOT_DEPLOYED"; + /** Search by user-name who created the ioc */ + createdBy?: string; + /** Network */ + network?: string; + /** Network scope */ + networkScope?: string; + /** Host type */ + hostType?: string; + /** Host name */ + hostName?: string; + /** Search text (Search for Naming name) */ + query?: string; + /** Order by */ + orderBy?: "ID" | "CREATED_BY" | "IOC_NAME"; + /** Order Ascending */ + orderAsc?: boolean; + /** Page offset */ + page?: number; + /** Page size */ + limit?: number; + /** Use this parameter to list all IOCs in the response! Setting this parameter to true will override the Page and Limit parameters! */ + listAll?: boolean; +}; +export type CreateIocApiResponse = /** status 201 IOC created */ Ioc; +export type CreateIocApiArg = { + createIoc: CreateIoc; +}; +export type StartOperationApiResponse = + /** status 201 IOC operation initiated */ Operation; +export type StartOperationApiArg = { + /** The ID of the IOC to start an operation on */ + iocId: number; + createJobRequest: CreateJobRequest; +}; +export type UpdateJobApiResponse = + /** status 200 Job updated */ GeneralException; +export type UpdateJobApiArg = { + awxJobMeta: AwxJobMeta; +}; +export type TokenRenewApiResponse = /** status 200 Ok */ LoginResponse; +export type TokenRenewApiArg = void; +export type LoginApiResponse = /** status 200 Ok */ LoginResponse; +export type LoginApiArg = { + login: Login; +}; +export type GetIocApiResponse = /** status 200 Found IOC */ IocDetails; +export type GetIocApiArg = { + /** Unique ID of IOC */ + iocId: number; +}; +export type DeleteIocApiResponse = /** status 204 IOC deleted */ string; +export type DeleteIocApiArg = { + /** Id of IOC to delete */ + iocId: number; +}; +export type UpdateIocApiResponse = /** status 200 IOC updated */ Ioc; +export type UpdateIocApiArg = { + /** Unique ID of IOC */ + iocId: number; + iocUpdateRequest: IocUpdateRequest; +}; +export type UnDeployInDbApiResponse = + /** status 200 Undeployment created */ Deployment[]; +export type UnDeployInDbApiArg = { + /** The id of the IOC to undeploy */ + iocId: number; +}; +export type UpdateActiveDeploymentHostApiResponse = + /** status 200 Successful host update */ Ioc[]; +export type UpdateActiveDeploymentHostApiArg = { + /** The ID of the IOC */ + iocId: number; + updateHostRequest: UpdateHostRequest; +}; +export type GetHealthCheckApiResponse = /** status 200 OK */ string; +export type GetHealthCheckApiArg = void; +export type CalculateStatisticsApiResponse = + /** status 200 Calculate statistics */ StatisticResponse; +export type CalculateStatisticsApiArg = { + statisticsType: + | "HOSTS_REGISTERED" + | "HOSTS_WITH_IOCS" + | "HOSTS_REACHABLE" + | "HOSTS_WITH_ACTIVE_IOCS" + | "IOCS_REGISTERED" + | "IOCS_DEPLOYED" + | "IOCS_RUNNING"; +}; +export type OperationHistoryApiResponse = + /** status 200 Operations history from DB for statistics */ OperationStatisticsResponse; +export type OperationHistoryApiArg = void; +export type CurrentlyActiveIocsApiResponse = + /** status 200 Statistics about currently active IOCs */ ActiveIocStatisticsResponse[]; +export type CurrentlyActiveIocsApiArg = void; +export type ActiveIocHistoryApiResponse = + /** status 200 History about active IOCs for statistics */ ActiveIocsForHistoryResponse[]; +export type ActiveIocHistoryApiArg = void; +export type FindAllRecordsApiResponse = + /** status 200 A paged array of Channel Finder records */ PagedRecordResponse; +export type FindAllRecordsApiArg = { + /** Search text (Search for record name or description) */ + text?: string; + /** Part of the IOC name that has to be searched */ + iocName?: string; + /** PV status */ + pvStatus?: "ACTIVE" | "INACTIVE"; + /** Page offset */ + page?: number; + /** Page size */ + limit?: string; +}; +export type GetRecordApiResponse = /** status 200 Found record */ RecordDetails; +export type GetRecordApiArg = { + /** Unique (part of the) name of the record */ + name: string; +}; +export type FetchDeploymentApiResponse = + /** status 200 A deployment with details */ DeploymentInfoDetails; +export type FetchDeploymentApiArg = { + /** Unique ID of deployment */ + deploymentId: number; +}; +export type ListOperationsApiResponse = + /** status 200 A paged array of deployments */ PagedOperationResponse; +export type ListOperationsApiArg = { + /** IOC ID */ + iocId?: number; + /** Type */ + type?: "DEPLOYMENT" | "COMMAND"; + /** Status */ + status?: + | "QUEUED" + | "RUNNING" + | "SUCCESSFUL" + | "FAILED" + | "FINISHED" + | "ONGOING"; + /** User name */ + user?: string; + /** Search text (Search for IOC name, Created by) */ + query?: string; + /** Start date */ + startDate?: string; + /** End date */ + endDate?: string; + /** Time zone ID */ + timeZone?: string; + /** Host ID for the host */ + hostId?: string; + /** Order by */ + orderBy?: "USER" | "TIME" | "IOC_NAME" | "GIT_REFERENCE"; + /** Order Ascending */ + orderAsc?: boolean; + /** Page offset */ + page?: number; + /** Page size */ + limit?: number; +}; +export type FetchOperationApiResponse = + /** status 200 Operation details */ OperationDetails; +export type FetchOperationApiArg = { + /** Unique ID of operation */ + operationId: number; +}; +export type FetchJobDetailsApiResponse = + /** status 200 Job details */ AwxJobDetails; +export type FetchJobDetailsApiArg = { + /** Unique ID of the job */ + jobId: number; +}; +export type FetchDeploymentJobLogApiResponse = + /** status 200 Job log */ AwxJobLog; +export type FetchDeploymentJobLogApiArg = { + /** Unique ID of the job */ + jobId: number; +}; +export type FetchIocByNameApiResponse = + /** status 200 Naming names, and UUIDs from the Names service */ NameResponse[]; +export type FetchIocByNameApiArg = { + /** IOC name */ + iocName?: string; +}; +export type CheckNamingUuIdApiResponse = /** status 200 Ok */ IdUsedByIoc; +export type CheckNamingUuIdApiArg = { + /** Naming UUID */ + namingUuid: string; +}; +export type FetchIocStatusApiResponse = + /** status 200 Log lines */ IocStatusResponse; +export type FetchIocStatusApiArg = { + /** Unique ID of the IOC */ + iocId: number; +}; +export type GetIocDescriptionApiResponse = + /** status 200 Found IOC description */ IocDescriptionResponse; +export type GetIocDescriptionApiArg = { + /** Unique ID of IOC */ + iocId: number; +}; +export type FetchIocAlertsApiResponse = + /** status 200 Alerts of the IOC */ IocAlertResponse; +export type FetchIocAlertsApiArg = { + /** Unique ID of the IOC */ + iocId: number; +}; +export type FetchProcServLogLinesApiResponse = + /** status 200 Log lines */ LokiResponse; +export type FetchProcServLogLinesApiArg = { + /** Host name (without network part) */ + hostName: string; + /** Name of the IOC to get procServ logs */ + iocName: string; + /** Time range (in minutes) */ + timeRange?: number; +}; +export type CheckGitRepoIdApiResponse = /** status 200 Ok */ IdUsedByIoc; +export type CheckGitRepoIdApiArg = { + /** Git repository Id */ + repoId: number; +}; +export type ListHostsApiResponse = + /** status 200 A paged array of hosts */ PagedNetBoxHostResponse; +export type ListHostsApiArg = { + /** Search text (Search for host name or description) */ + text?: string; + /** Filtering depending on deployments */ + filter?: "ALL" | "IOCS_DEPLOYED" | "NO_IOCS" | "OWN"; + /** Page offset */ + page?: number; + /** Page size */ + limit?: string; + /** Use this parameter to list all Hosts in the response! Setting this parameter to true will override the Page and Limit parameters! */ + listAll?: boolean; +}; +export type FetchSyslogLinesApiResponse = + /** status 200 Log lines */ LokiResponse; +export type FetchSyslogLinesApiArg = { + /** Host name (without network part) */ + hostName: string; + /** Time range (in minutes) */ + timeRange?: number; +}; +export type FindHostStatusApiResponse = + /** status 200 Host status */ HostStatusResponse; +export type FindHostStatusApiArg = { + /** Host identifier */ + hostId: string; +}; +export type FindAssociatedIocsByHostIdApiResponse = + /** status 200 Found Host */ PagedAssociatedIocs; +export type FindAssociatedIocsByHostIdApiArg = { + /** Host identifier */ + hostId: string; + /** IOC Name */ + iocName?: string; + /** Order by */ + orderBy?: "ID" | "CREATED_BY" | "IOC_NAME"; + /** Order Ascending */ + orderAsc?: boolean; + /** Page offset */ + page?: number; + /** Page size */ + limit?: string; +}; +export type FindNetBoxHostByHostIdApiResponse = + /** status 200 Found Host */ HostInfoWithId; +export type FindNetBoxHostByHostIdApiArg = { + /** The host's Host ID */ + hostId: string; +}; +export type FindHostAlertsApiResponse = + /** status 200 Host alerts */ HostAlertResponse; +export type FindHostAlertsApiArg = { + /** Host identifier */ + hostId: string; +}; +export type FindNetBoxHostByFqdnApiResponse = + /** status 200 Found Host */ HostInfoWithId; +export type FindNetBoxHostByFqdnApiArg = { + /** The host's FQDN */ + fqdn: string; +}; +export type ListTagsAndCommitIdsApiResponse = + /** status 200 List of Tags and CommitIds for a specific GitLab repo */ GitReference[]; +export type ListTagsAndCommitIdsApiArg = { + /** Git repo project ID */ + projectId: number; + /** Git reference */ + reference?: string; + /** Search method - optional. Default value: filtering ref by EQUALS method */ + searchMethod?: "EQUALS" | "CONTAINS"; +}; +export type GitReferenceTypeApiResponse = + /** status 200 Git reference type */ ReferenceTypeResponse; +export type GitReferenceTypeApiArg = { + /** Git repo project ID */ + projectId: number; + /** Git reference */ + gitReference: string; +}; +export type InfoFromUserNameApiResponse = + /** status 200 Information about the current user */ UserInfoResponse[]; +export type InfoFromUserNameApiArg = { + /** The username to retrieve info from - optional. If no user name provided the backend will look up for currently logged in user name */ + userName?: string; +}; +export type ListProjectsApiResponse = + /** status 200 List of Gitlab projects of allowed groups */ GitProject[]; +export type ListProjectsApiArg = { + /** Search text (Search for Git repository name) */ + query?: string; +}; +export type GitProjectDetailsApiResponse = + /** status 200 Git project details */ GitProjectDto; +export type GitProjectDetailsApiArg = { + /** Git repo project ID */ + projectId: number; +}; +export type GetToolUsersApiResponse = /** status 200 Ok */ string[]; +export type GetToolUsersApiArg = { + /** User name query */ + query?: string; +}; +export type GetUserRolesApiResponse = /** status 200 Ok */ string[]; +export type GetUserRolesApiArg = void; +export type LogoutApiResponse = /** status 200 Ok */ object; +export type LogoutApiArg = void; +export type MaintenanceMode = { + startAt?: string; + endAt?: string; + message?: string; +}; +export type GeneralException = { + error?: string; + description?: string; +}; +export type SetMaintenance = { + startAt?: string; + endAt?: string; + message?: string; +}; +export type DeploymentHostInfo = { + hostId?: string; + hostName?: string; + network?: string; + fqdn?: string; + netBoxHostFromCache?: boolean; +}; +export type ActiveDeployment = { + host?: DeploymentHostInfo; + sourceVersion?: string; + sourceVersionShort?: string; +}; +export type IocInfo = { + id?: number; + namingName?: string; + createdBy?: string; + gitProjectId?: number; + deployedWithOldPlaybook?: boolean; + activeDeployment?: ActiveDeployment; +}; +export type PagedIocResponse = { + totalCount?: number; + listSize?: number; + pageNumber?: number; + limit?: number; + iocList?: IocInfo[]; +}; +export type Host = { + hostId?: string; + externalIdValid?: boolean; + fqdn?: string; + hostName?: string; + network?: string; +}; +export type Deployment = { + id?: number; + createdBy?: string; + startDate?: string; + createdAt?: string; + undeployment?: boolean; + namingName?: string; + gitProjectId?: number; + sourceVersion?: string; + operationId?: number; + endDate?: string; + iocName?: string; + host?: Host; + jobId?: number; + sourceUrl?: string; + sourceVersionShort?: string; + operationStatus?: "UNKNOWN" | "QUEUED" | "RUNNING" | "FAILED" | "SUCCESSFUL"; +}; +export type Ioc = { + id?: number; + description?: string; + createdBy?: string; + namingName?: string; + namingUuid?: string; + gitProjectId?: number; + sourceUrl?: string; + activeDeployment?: Deployment; + deployedWithOldPlaybook?: boolean; +}; +export type CreateIoc = { + namingUuid?: string; + gitProjectId?: number; + repository_name?: string; +}; +export type Operation = { + id?: number; + createdBy?: string; + startTime?: string; + createdAt?: string; + finishedAt?: string; + type?: "DEPLOY" | "UNDEPLOY" | "START" | "STOP"; + iocName?: string; + iocId?: number; + deploymentId?: number; + gitProjectId?: number; + gitReference?: string; + status?: "UNKNOWN" | "QUEUED" | "RUNNING" | "FAILED" | "SUCCESSFUL"; + host?: DeploymentHostInfo; +}; +export type CreateJobRequest = { + type?: "DEPLOY" | "UNDEPLOY" | "START" | "STOP"; + sourceVersion?: string; + hostId?: string; +}; +export type AwxJobMeta = { + id?: number; + started?: string; + finished?: string; + status?: + | "UNKNOWN" + | "CREATED" + | "QUEUED_BY_BACKEND" + | "new" + | "pending" + | "waiting" + | "running" + | "failed" + | "canceled" + | "error" + | "successful"; +}; +export type LoginResponse = { + token?: string; +}; +export type Login = { + userName?: string; + password?: string; +}; +export type IocDetails = { + id?: number; + description?: string; + createdBy?: string; + namingName?: string; + namingUuid?: string; + gitProjectId?: number; + sourceUrl?: string; + activeDeployment?: Deployment; + deployedWithOldPlaybook?: boolean; + operationInProgress?: boolean; +}; +export type IocUpdateRequest = { + namingUuid?: string; + gitProjectId?: number; +}; +export type UpdateHostRequest = { + hostId?: string; +}; +export type StatisticResponse = { + value?: number; + statisticType?: + | "HOSTS_REGISTERED" + | "HOSTS_WITH_IOCS" + | "HOSTS_REACHABLE" + | "HOSTS_WITH_ACTIVE_IOCS" + | "IOCS_REGISTERED" + | "IOCS_DEPLOYED" + | "IOCS_RUNNING"; +}; +export type OperationStatistic = { + deploymentCount?: number; + commandCount?: number; + historyDate?: string; +}; +export type OperationStatisticsResponse = { + operationStatistics?: OperationStatistic[]; +}; +export type ActiveIocStatisticsResponse = { + network?: string; + iocCount?: number; +}; +export type ActiveIocsForHistoryResponse = { + iocCount?: number; + historyDate?: string; +}; +export type Record = { + name?: string; + iocName?: string; + iocId?: number; + hostName?: string; + pvStatus?: "ACTIVE" | "INACTIVE"; + iocVersion?: string; + description?: string; + recordType?: string; + alias?: string; +}; +export type PagedRecordResponse = { + totalCount?: number; + listSize?: number; + pageNumber?: number; + limit?: number; + recordList?: Record[]; +}; +export type RecordDetails = { + name?: string; + iocName?: string; + iocId?: number; + hostName?: string; + pvStatus?: "ACTIVE" | "INACTIVE"; + iocVersion?: string; + description?: string; + recordType?: string; + alias?: string; + properties?: { + [key: string]: string; + }; + hostId?: string; +}; +export type HostWithFqdn = { + hostId?: string; + externalIdValid?: boolean; + fqdn?: string; +}; +export type Alert = { + type?: "ERROR" | "WARNING" | "INFO"; + message?: string; + link?: string; +}; +export type DeploymentInfoDetails = { + id?: number; + createdBy?: string; + startDate?: string; + createdAt?: string; + undeployment?: boolean; + namingName?: string; + gitProjectId?: number; + sourceVersion?: string; + operationId?: number; + endDate?: string; + host?: HostWithFqdn; + jobId?: number; + iocId?: number; + jobUrl?: string; + sourceUrl?: string; + sourceVersionShort?: string; + alerts?: Alert[]; +}; +export type PagedOperationResponse = { + totalCount?: number; + listSize?: number; + pageNumber?: number; + limit?: number; + operations?: Operation[]; +}; +export type OperationDetails = { + id?: number; + createdBy?: string; + startTime?: string; + createdAt?: string; + finishedAt?: string; + type?: "DEPLOY" | "UNDEPLOY" | "START" | "STOP"; + iocName?: string; + iocId?: number; + deploymentId?: number; + gitProjectId?: number; + gitReference?: string; + status?: "UNKNOWN" | "QUEUED" | "RUNNING" | "FAILED" | "SUCCESSFUL"; + gitProjectUrl?: string; + gitShortReference?: string; + host?: HostWithFqdn; + jobId?: number; + jobUrl?: string; + alerts?: Alert[]; +}; +export type AwxJobDetails = { + id?: number; + status?: "UNKNOWN" | "QUEUED" | "RUNNING" | "FAILED" | "SUCCESSFUL"; + started?: string; + finished?: string; +}; +export type AwxJobLog = { + jobId?: number; + stdoutHtml?: string; + elapsed?: number; +}; +export type NameResponse = { + uuid?: string; + name?: string; + description?: string; +}; +export type IdUsedByIoc = { + iocId?: number; +}; +export type IocStatusResponse = { + iocId?: number; + isActive?: boolean; +}; +export type IocDescriptionResponse = { + description?: string; +}; +export type IocAlertResponse = { + alertSeverity?: "ERROR" | "WARNING" | "INFO"; + alerts?: Alert[]; + iocId?: number; +}; +export type LokiMessage = { + logDate?: string; + logMessage?: string; +}; +export type LokiResponse = { + lines?: LokiMessage[]; + warning?: string; +}; +export type HostInfoWithId = { + id?: number; + fqdn?: string; + name?: string; + scope?: string; + description?: string; + network?: string; + deviceType?: string; + tags?: string[]; + hostId?: string; + vm?: boolean; +}; +export type PagedNetBoxHostResponse = { + totalCount?: number; + listSize?: number; + pageNumber?: number; + limit?: number; + netBoxHosts?: HostInfoWithId[]; +}; +export type HostStatusResponse = { + hostId?: string; + assigned?: boolean; + status?: "AVAILABLE" | "UNREACHABLE"; +}; +export type PagedAssociatedIocs = { + totalCount?: number; + listSize?: number; + pageNumber?: number; + limit?: number; + deployedIocs?: IocInfo[]; +}; +export type HostAlertResponse = { + hostId?: string; + alertSeverity?: "ERROR" | "WARNING" | "INFO"; + alerts?: Alert[]; +}; +export type GitReference = { + reference?: string; + description?: string; + type?: "TAG" | "COMMIT" | "UNKNOWN"; + short_reference?: string; + commit_date?: string; +}; +export type ReferenceTypeResponse = { + reference_type?: "TAG" | "COMMIT" | "UNKNOWN"; +}; +export type UserInfoResponse = { + fullName?: string; + loginName?: string; + avatar?: string; + email?: string; + gitlabUserName?: string; +}; +export type GitProject = { + id?: number; + url?: string; +}; +export type GitProjectDto = { + id?: number; + name?: string; + description?: string; + projectUrl?: string; +}; +export const { + useSetMaintenanceModeMutation, + useGetCurrentModeQuery, + useLazyGetCurrentModeQuery, + useEndCurrentMaintenanceModeMutation, + useListIocsQuery, + useLazyListIocsQuery, + useCreateIocMutation, + useStartOperationMutation, + useUpdateJobMutation, + useTokenRenewMutation, + useLoginMutation, + useGetIocQuery, + useLazyGetIocQuery, + useDeleteIocMutation, + useUpdateIocMutation, + useUnDeployInDbMutation, + useUpdateActiveDeploymentHostMutation, + useGetHealthCheckQuery, + useLazyGetHealthCheckQuery, + useCalculateStatisticsQuery, + useLazyCalculateStatisticsQuery, + useOperationHistoryQuery, + useLazyOperationHistoryQuery, + useCurrentlyActiveIocsQuery, + useLazyCurrentlyActiveIocsQuery, + useActiveIocHistoryQuery, + useLazyActiveIocHistoryQuery, + useFindAllRecordsQuery, + useLazyFindAllRecordsQuery, + useGetRecordQuery, + useLazyGetRecordQuery, + useFetchDeploymentQuery, + useLazyFetchDeploymentQuery, + useListOperationsQuery, + useLazyListOperationsQuery, + useFetchOperationQuery, + useLazyFetchOperationQuery, + useFetchJobDetailsQuery, + useLazyFetchJobDetailsQuery, + useFetchDeploymentJobLogQuery, + useLazyFetchDeploymentJobLogQuery, + useFetchIocByNameQuery, + useLazyFetchIocByNameQuery, + useCheckNamingUuIdQuery, + useLazyCheckNamingUuIdQuery, + useFetchIocStatusQuery, + useLazyFetchIocStatusQuery, + useGetIocDescriptionQuery, + useLazyGetIocDescriptionQuery, + useFetchIocAlertsQuery, + useLazyFetchIocAlertsQuery, + useFetchProcServLogLinesQuery, + useLazyFetchProcServLogLinesQuery, + useCheckGitRepoIdQuery, + useLazyCheckGitRepoIdQuery, + useListHostsQuery, + useLazyListHostsQuery, + useFetchSyslogLinesQuery, + useLazyFetchSyslogLinesQuery, + useFindHostStatusQuery, + useLazyFindHostStatusQuery, + useFindAssociatedIocsByHostIdQuery, + useLazyFindAssociatedIocsByHostIdQuery, + useFindNetBoxHostByHostIdQuery, + useLazyFindNetBoxHostByHostIdQuery, + useFindHostAlertsQuery, + useLazyFindHostAlertsQuery, + useFindNetBoxHostByFqdnQuery, + useLazyFindNetBoxHostByFqdnQuery, + useListTagsAndCommitIdsQuery, + useLazyListTagsAndCommitIdsQuery, + useGitReferenceTypeQuery, + useLazyGitReferenceTypeQuery, + useInfoFromUserNameQuery, + useLazyInfoFromUserNameQuery, + useListProjectsQuery, + useLazyListProjectsQuery, + useGitProjectDetailsQuery, + useLazyGitProjectDetailsQuery, + useGetToolUsersQuery, + useLazyGetToolUsersQuery, + useGetUserRolesQuery, + useLazyGetUserRolesQuery, + useLogoutMutation +} = injectedRtkApi; -- GitLab