Skip to content

Commit

Permalink
Merge pull request #19 from karelhala/host-inventory-delete
Browse files Browse the repository at this point in the history
Update host inventory to allow host delete
  • Loading branch information
Hyperkid123 authored May 23, 2019
2 parents d671331 + 2b77c68 commit 30f5f73
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 33 deletions.
6 changes: 3 additions & 3 deletions packages/approval/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

6 changes: 3 additions & 3 deletions packages/catalog/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

6 changes: 3 additions & 3 deletions packages/entitlements/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

77 changes: 77 additions & 0 deletions packages/host-inventory/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,47 @@ export const HostsApiAxiosParamCreator = function (configuration?: Configuration
options: localVarRequestOptions,
};
},
/**
* Delete hosts by IDs
* @summary Delete hosts by IDs
* @param {Array<string>} hostIdList A comma separated list of host IDs.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiHostDeleteById(hostIdList: Array<string>, options: any = {}): RequestArgs {
// verify required parameter 'hostIdList' is not null or undefined
if (hostIdList === null || hostIdList === undefined) {
throw new RequiredError('hostIdList','Required parameter hostIdList was null or undefined when calling apiHostDeleteById.');
}
const localVarPath = `/hosts/{host_id_list}`
.replace(`{${"host_id_list"}}`, encodeURIComponent(String(hostIdList)));
const localVarUrlObj = url.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions, options);
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication ApiKeyAuth required
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? configuration.apiKey("x-rh-identity")
: configuration.apiKey;
localVarHeaderParameter["x-rh-identity"] = localVarApiKeyValue;
}

localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

return {
url: url.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Find one or more hosts by their ID.
* @summary Find hosts by their IDs
Expand Down Expand Up @@ -1341,6 +1382,20 @@ export const HostsApiFp = function(configuration?: Configuration) {
return axios.request(axiosRequestArgs);
};
},
/**
* Delete hosts by IDs
* @summary Delete hosts by IDs
* @param {Array<string>} hostIdList A comma separated list of host IDs.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiHostDeleteById(hostIdList: Array<string>, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Response> {
const localVarAxiosArgs = HostsApiAxiosParamCreator(configuration).apiHostDeleteById(hostIdList, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = Object.assign(localVarAxiosArgs.options, {url: basePath + localVarAxiosArgs.url})
return axios.request(axiosRequestArgs);
};
},
/**
* Find one or more hosts by their ID.
* @summary Find hosts by their IDs
Expand Down Expand Up @@ -1461,6 +1516,16 @@ export const HostsApiFactory = function (configuration?: Configuration, basePath
apiHostAddHostList(createHostIn: Array<CreateHostIn>, options?: any) {
return HostsApiFp(configuration).apiHostAddHostList(createHostIn, options)(axios, basePath);
},
/**
* Delete hosts by IDs
* @summary Delete hosts by IDs
* @param {Array<string>} hostIdList A comma separated list of host IDs.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiHostDeleteById(hostIdList: Array<string>, options?: any) {
return HostsApiFp(configuration).apiHostDeleteById(hostIdList, options)(axios, basePath);
},
/**
* Find one or more hosts by their ID.
* @summary Find hosts by their IDs
Expand Down Expand Up @@ -1560,6 +1625,18 @@ export class HostsApi extends BaseAPI {
return HostsApiFp(this.configuration).apiHostAddHostList(createHostIn, options)(this.axios, this.basePath);
}

/**
* Delete hosts by IDs
* @summary Delete hosts by IDs
* @param {Array<string>} hostIdList A comma separated list of host IDs.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HostsApi
*/
public apiHostDeleteById(hostIdList: Array<string>, options?: any) {
return HostsApiFp(this.configuration).apiHostDeleteById(hostIdList, options)(this.axios, this.basePath);
}

/**
* Find one or more hosts by their ID.
* @summary Find hosts by their IDs
Expand Down
4 changes: 2 additions & 2 deletions packages/host-inventory/doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ___

**HostsApiFactory**(configuration?: *[Configuration](classes/configuration.md)*, basePath?: *`string`*, axios?: *`AxiosInstance`*): `object`

*Defined in [api.ts:1452](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1452)*
*Defined in [api.ts:1507](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1507)*

HostsApi - factory interface

Expand All @@ -175,7 +175,7 @@ ___

**HostsApiFp**(configuration?: *[Configuration](classes/configuration.md)*): `object`

*Defined in [api.ts:1328](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1328)*
*Defined in [api.ts:1369](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1369)*

HostsApi - functional programming interface

Expand Down
41 changes: 34 additions & 7 deletions packages/host-inventory/doc/classes/hostsapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ HostsApi - object-oriented interface
### Methods

* [apiHostAddHostList](hostsapi.md#apihostaddhostlist)
* [apiHostDeleteById](hostsapi.md#apihostdeletebyid)
* [apiHostGetHostById](hostsapi.md#apihostgethostbyid)
* [apiHostGetHostList](hostsapi.md#apihostgethostlist)
* [apiHostGetHostSystemProfileById](hostsapi.md#apihostgethostsystemprofilebyid)
Expand Down Expand Up @@ -108,7 +109,7 @@ ___

**apiHostAddHostList**(createHostIn: *`Array`<[CreateHostIn](../interfaces/createhostin.md)>*, options?: *`any`*): `AxiosPromise`<[BulkHostOut](../interfaces/bulkhostout.md)>

*Defined in [api.ts:1559](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1559)*
*Defined in [api.ts:1624](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1624)*

Create a new host and add it to the host list or update an existing hosts. A host is updated if there is already one with the same canonicals facts and belonging to the same account.

Expand All @@ -127,14 +128,40 @@ Create a new host and add it to the host list or update an existing hosts. A hos

**Returns:** `AxiosPromise`<[BulkHostOut](../interfaces/bulkhostout.md)>

___
<a id="apihostdeletebyid"></a>

### apiHostDeleteById

**apiHostDeleteById**(hostIdList: *`Array`<`string`>*, options?: *`any`*): `AxiosPromise`<`Response`>

*Defined in [api.ts:1636](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1636)*

Delete hosts by IDs

*__summary__*: Delete hosts by IDs

*__throws__*: {RequiredError}

*__memberof__*: HostsApi

**Parameters:**

| Name | Type | Description |
| ------ | ------ | ------ |
| hostIdList | `Array`<`string`> | A comma separated list of host IDs. |
| `Optional` options | `any` |

**Returns:** `AxiosPromise`<`Response`>

___
<a id="apihostgethostbyid"></a>

### apiHostGetHostById

**apiHostGetHostById**(hostIdList: *`Array`<`string`>*, branchId?: *`string`*, perPage?: *`number`*, page?: *`number`*, options?: *`any`*): `AxiosPromise`<[HostQueryOutput](../interfaces/hostqueryoutput.md)>

*Defined in [api.ts:1574](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1574)*
*Defined in [api.ts:1651](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1651)*

Find one or more hosts by their ID.

Expand Down Expand Up @@ -163,7 +190,7 @@ ___

**apiHostGetHostList**(displayName?: *`string`*, fqdn?: *`string`*, hostnameOrId?: *`string`*, insightsId?: *`string`*, branchId?: *`string`*, perPage?: *`number`*, page?: *`number`*, options?: *`any`*): `AxiosPromise`<[HostQueryOutput](../interfaces/hostqueryoutput.md)>

*Defined in [api.ts:1592](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1592)*
*Defined in [api.ts:1669](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1669)*

Read the entire list of all hosts available to the account.

Expand Down Expand Up @@ -195,7 +222,7 @@ ___

**apiHostGetHostSystemProfileById**(hostIdList: *`Array`<`string`>*, perPage?: *`number`*, page?: *`number`*, options?: *`any`*): `AxiosPromise`<[SystemProfileByHostOut](../interfaces/systemprofilebyhostout.md)>

*Defined in [api.ts:1606](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1606)*
*Defined in [api.ts:1683](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1683)*

Find one or more hosts by their ID and return the id and system profile

Expand Down Expand Up @@ -223,7 +250,7 @@ ___

**apiHostMergeFacts**(hostIdList: *`Array`<`string`>*, namespace: *`string`*, body: *`any`*, options?: *`any`*): `AxiosPromise`<`Response`>

*Defined in [api.ts:1620](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1620)*
*Defined in [api.ts:1697](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1697)*

Merge one or multiple hosts facts under a namespace.

Expand Down Expand Up @@ -251,7 +278,7 @@ ___

**apiHostPatchById**(hostIdList: *`Array`<`string`>*, patchHostIn: *[PatchHostIn](../interfaces/patchhostin.md)*, branchId?: *`string`*, options?: *`any`*): `AxiosPromise`<`Response`>

*Defined in [api.ts:1634](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1634)*
*Defined in [api.ts:1711](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1711)*

Update a host

Expand Down Expand Up @@ -279,7 +306,7 @@ ___

**apiHostReplaceFacts**(hostIdList: *`Array`<`string`>*, namespace: *`string`*, body: *`any`*, options?: *`any`*): `AxiosPromise`<`Response`>

*Defined in [api.ts:1648](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1648)*
*Defined in [api.ts:1725](https://github.com/RedHatInsights/javascript-clients/blob/master/packages/host-inventory/api.ts#L1725)*

Replace facts under a namespace

Expand Down
6 changes: 3 additions & 3 deletions packages/host-inventory/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

6 changes: 3 additions & 3 deletions packages/rbac/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

6 changes: 3 additions & 3 deletions packages/sources/doc/classes/requirederror.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ___

*Inherited from Error.message*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:964*

___
<a id="name"></a>
Expand All @@ -94,7 +94,7 @@ ___

*Overrides Error.stack*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:965*

___
<a id="error"></a>
Expand All @@ -103,7 +103,7 @@ ___

**● Error**: *`ErrorConstructor`*

*Defined in /home/mmarosi/insights/javascript-clients/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974*
*Defined in node_modules/typescript/lib/lib.es5.d.ts:974*

___

Loading

0 comments on commit 30f5f73

Please sign in to comment.