@gridscale/gsclient-js
Version:
gridscale API Wrapper
103 lines (102 loc) • 3.83 kB
TypeScript
import { APIClass, ApiResult, GenericApiResult, RequestOptions, VoidApiResult } from '../api';
import * as models from './../Specs';
declare class Location {
_api: APIClass;
_defaults: RequestOptions;
_basepath: string;
/**
* Create Object Endpoint
*
*
* @param _api API Class Instance
* @param _path Path to the Object
*/
constructor(_api: APIClass);
/**
* Overwrite Default Settings for this Type
*
* @param _options
*/
setDefaults(_options: RequestOptions): void;
/**
* Add Local Options with Defaults
*
*
* @param _options
* @returns {RequestOptions}
* @private
*/
_buildRequestOptions(_options?: RequestOptions): {
page?: number;
limit?: number;
fields?: string[];
filter?: string[];
sort?: string | string[];
};
/**
* List Objects
*
*
* @param _options
* @param _callback
* @returns {Promise<ApiResult<models.LocationsGetResponse>>}
*/
list(_options?: RequestOptions, _callback?: (response: Response, result: ApiResult<GenericApiResult>) => void): Promise<ApiResult<models.LocationsGetResponse>>;
/**
* Create location
* @param _attributes
* @param _callback
* @returns {Promise<ApiResult<CreateResult>>}
*/
create(_attributes: models.LocationCreate, _callback?: (response: Response, result: ApiResult<GenericApiResult>) => void): Promise<ApiResult<models.CreateResponse>>;
/**
* Patch location
* @param _attributes
* @param _callback
* @returns {Promise<ApiResult<VoidApiResult>>}
*/
patch(_uuid: string, _attributes: models.LocationUpdate, _callback?: (response: Response, result: ApiResult<GenericApiResult>) => void): Promise<ApiResult<VoidApiResult>>;
/**
* remove Single location by UUID
*
* @param _uuid
* @param _callback
*/
remove(_uuid: string, _callback?: (response: Response, result: ApiResult<GenericApiResult>) => void): Promise<ApiResult<VoidApiResult>>;
/**
* Get Single Object by UUID
*
* @param _uuid
* @param _callback
*/
get(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.LocationGetResponse>>;
/**
Return all IP Adresses for this locations
*/
getLocationIPs(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.IpsGetResponse>>;
/**
Return all isoimages for this location
*/
getLocationISOImages(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.IsoimagesGetResponse>>;
/**
Return all networks for this location
*/
getLocationNetworks(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.NetworksGetResponse>>;
/**
Return all servers for this location
*/
getLocationServers(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.ServersGetResponse>>;
/**
Return all snapshots for this location
*/
getLocationSnapshots(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.SnapshotGetResponse>>;
/**
Return all storages for this location
*/
getLocationStorages(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.StoragesGetResponse>>;
/**
Return all storages for this location
*/
getLocationTemplates(_uuid: string, _callback?: ((response: Response, result: ApiResult<any>) => void)): Promise<ApiResult<models.TemplatesGetResponse>>;
}
export { Location };