From 34bff710dfc9a7fb788e8cb1d47bf28e5a8c0b27 Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Thu, 10 Aug 2017 15:57:21 +0800 Subject: [PATCH 1/6] types support added for openstack-wrapper package --- openstack-wrapper/index.d.ts | 270 +++++++++++++++++++ openstack-wrapper/openstack-wrapper-tests.ts | 3 + 2 files changed, 273 insertions(+) create mode 100644 openstack-wrapper/index.d.ts create mode 100644 openstack-wrapper/openstack-wrapper-tests.ts diff --git a/openstack-wrapper/index.d.ts b/openstack-wrapper/index.d.ts new file mode 100644 index 0000000000..e2c41db48f --- /dev/null +++ b/openstack-wrapper/index.d.ts @@ -0,0 +1,270 @@ +// Type definitions for openstack-wrapper 2.1.6 +// Project: https://www.npmjs.com/package/openstack-wrapper +// Definitions by: Sanjay Madane +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +export interface RequestOption{ + uri?: string; + headers?: any, + json?: any, + timeout?: any, + metricRequestID?: string, + metricUserName?: string, + metricLogger?: any +} + +export class Glance { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any); + setRequestID(request_id: any); + setUserName(user_name: string); + setLogger(logger: any); + setRequest(request_lib: any); + setMangler(mangle_lib: any); + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listImages(cb: Function); + getImage(id: any, cb: Function); + queueImage(data: any, cb: Function); + uploadImage(id: any, stream: any, cb: Function); + updateImage(id: any, data: any, cb: Function); + removeImage(id: any, cb: Function); +} + +export class Keystone { + request: any; + mangler:any; + mangleObject:any; + url:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string); + + setTimeout(new_timeout: any); + setRequestID(request_id: any); + setUserName(user_name: string); + setLogger(logger: any); + setRequest(request_lib: any); + setMangler(mangle_lib: any); + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + getToken(username: string, password: string, cb: Function); + getProjectTokenForReal(auth_data: any, cb: Function); + getProjectToken(access_token:any, project_id:any, cb: Function); + getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function); + listProjects(admin_access_token: any, cb: Function); + listUserProjects(username:any, access_token: any, cb: Function); + getProjectByName(admin_access_token: any, project_name:any, cb: Function); + listRoles(project_token:any, cb: Function); + listRoleAssignments(project_token:any, project_id:any, cb: Function); + addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function); + removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function); + listMetaEnvironments(auth_token:any, cb: Function); + listMetaOwningGroups(auth_token:any, cb: Function); + listProjectMeta(project_token:any, project_id:any, cb: Function); + updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function); +} + +export class Neutron { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any); + setRequestID(request_id: any); + setUserName(user_name: string); + setLogger(logger: any); + setRequest(request_lib: any); + setMangler(mangle_lib: any); + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listNetworks(cb: Function); + getNetwork(network_id:string, cb: Function); + listSubnets(cb: Function); + getSubnet(subnet_id:any, cb: Function); + listRouters(cb: Function); + getRouter(router_id:any, cb: Function); + createFloatingIp(floating_network_id:any, cb: Function); + listFloatingIps(options:any, cb: Function); + getFloatingIp(ip_id:any, cb: Function); + updateFloatingIp(ip_id:any, port_id:any,cb: Function); + removeFloatingIp(ip_id:any, cb: Function); + listPorts(options:any, cb: Function); + getPort(port_id:any,cb: Function); + updatePort(port_id:any, data:any, cb: Function); + listSecurityGroups(project_id:any, cb: Function); + getSecurityGroup(group_id:any, cb: Function); + createSecurityGroup(group_name:any, data:any, cb: Function); + updateSecurityGroup(group_id:any, data:any, cb: Function); + removeSecurityGroup(group_id:any, cb: Function); + listSecurityGroupRules(cb: Function); + getSecurityGroupRule(rule_id:any, cb: Function); + createSecurityGroupRule(group_id:any, data:any, cb: Function); + removeSecurityGroupRule(rule_id:any, cb: Function); + listLoadBalancers(cb: Function); + getLoadBalancer(lb_id:any, cb: Function); + createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function); + updateLoadBalancer(lb_id:any, data:any, cb: Function); + removeLoadBalancer(lb_id:any, cb: Function); + listLBListeners(cb: Function); + getLBListener(lb_id:any, cb: Function); + createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function); + updateLBListener(listener_id:any, data:any, cb: Function); + removeLBListener(listener_id:any, cb: Function); + listLBPools(cb: Function); + getLBPool(pool_id:any, cb: Function); + createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function); + updateLBPool(pool_id:any, data:any, cb: Function); + removeLBPool(pool_id:any, cb: Function); + listLBPoolMembers(pool_id:any, cb: Function); + getLBPoolMember(pool_id:any, member_id:any, cb: Function); + createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function); + updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function); + removeLBPoolMember(pool_id:any, member_id:any, cb: Function); + listLBHealthMonitors(cb: Function); + getLBHealthMonitor(health_monitor_id:any, cb: Function); + createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function); + updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function); + removeLBHealthMonitor(health_monitor_id:any, cb: Function); + getLBStats(lb_id:any, cb: Function); +} + +export class Octavia { + url:any; + token:any; + timeout:any; + request_id:any; + user_name:string; + logger:any; + retries: number; + retry_delay: number; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any); + setRequestID(request_id: any); + setUserName(user_name: string); + setLogger(logger: any); + setRequest(request_lib: any); + setRetries(retries:number); + setRetryDelay(retry_delay:number); + getRequestOptions(path: string, json_value:any):RequestOption; + listLoadBalancers(cb:Function); + getLoadBalancer(lb_id: string, cb:Function); + createLoadBalancer(project_id:string, data:any,cb:Function); + updateLoadBalancer(lb_id:string, data:any,cb:Function); + removeLoadBalancer(lb_id:string, cb:Function); + listLBListeners(cb:Function); + getLBListener(listener_id: string, cb:Function); + createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function); + updateLBListener(listener_id:string, data:any,cb:Function); + removeLBListener(listener_id: string, cb:Function); + listLBPools(cb:Function); + getLBPool(pool_id: string, cb:Function); + createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function); + updateLBPool(pool_id:string, data:any,cb:Function); + removeLBPool(pool_id:string, cb:Function); + listLBPoolMembers(pool_id:string, cb:Function); + getLBPoolMember(pool_id:string, member_id:string,cb:Function); + createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function); + updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function); + removeLBPoolMember(pool_id:string, member_id:string,cb:Function); + listLBHealthMonitors(cb:Function); + getLBHealthMonitor(health_monitor_id:string,cb:Function); + createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function); + updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function); + removeLBHealthMonitor(health_monitor_id:string,cb:Function); + getLBStats(lb_id:string,cb:Function); +} + +export class Nova { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any); + setRequestID(request_id: any); + setUserName(user_name: string); + setLogger(logger: any); + setRequest(request_lib: any); + setMangler(mangle_lib: any); + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listServers(cb:Function); + getServer(id:string, cb:Function); + createServer(data:any, cb:Function); + renameServer(id:string, name:string, cb:Function); + resizeServer(id:string, flavor:any,cb:Function); + confirmResizeServer(id: string, cb:Function); + revertResizeServer(id:string, cb:Function); + removeServer(id:string,cb:Function); + rebootServer(id:string, cb:Function); + forceRebootServer(id: string, cb:Function); + stopServer(id: string, cb:Function); + startServer(id: string, cb:Function); + pauseServer(id: string, cb:Function); + suspendServer(id: string, cb:Function); + resumeServer(is: string, cb:Function); + getServerConsoleURL(type: any, id: string, cb:Function); + getServerLog(id: string, length: any, cb:Function); + createServerImage(id: string , data: any,cb:Function); + setServerMetadata(id: string , data: any,cb:Function); + listFlavors(cb:Function); + getFlavor(id: string ,cb:Function); + listFloatingIps(cb:Function); + getFloatingIp(id: string, cb:Function); + createFloatingIp(data: any,cb:Function); + removeFloatingIp(id: string, cb:Function); + associateFloatingIp(instance_id:any, ip_address: any,cb:Function); + disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function); + listFloatingIpPools(cb:Function); + getFloatingIpPool(id: string, cb:Function); + listAvailabilityZones(cb:Function); + getAvailabilityZone(id: string, cb:Function); + listKeyPairs(cb:Function); + getKeyPair(id: string, cb:Function); + createKeyPair(name:string, public_key: any,cb:Function); + removeKeyPair(id:string,cb:Function); + getQuotaSet(project_id:string, cb:Function); + setQuotaSet(project_id:string, data: any,cb:Function); + getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function); + assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function); + removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function); + getImageMetaData(id:string, cb:Function); + setImageMetaData(id:string, data:any, cb:Function); +} + +export interface Project{ + general_token: string; + project_token: string; + glance: Glance; + neutron: Neutron; + nova: Nova; + octavia: Octavia; +} + +export class getSimpleProject{ + constructor(username: string, password: string, project_id: string, keystone_url: string, cb: Function); +} \ No newline at end of file diff --git a/openstack-wrapper/openstack-wrapper-tests.ts b/openstack-wrapper/openstack-wrapper-tests.ts new file mode 100644 index 0000000000..467948047c --- /dev/null +++ b/openstack-wrapper/openstack-wrapper-tests.ts @@ -0,0 +1,3 @@ +import * as openstack from 'openstack-wrapper'; + +const nova = new Glance("",""); \ No newline at end of file From 0f5e343c1365189253af81552541bd53420054fe Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Thu, 10 Aug 2017 16:12:03 +0800 Subject: [PATCH 2/6] added ts config and ts lint files --- openstack-wrapper/tsconfig.json | 0 openstack-wrapper/tslint.json | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 openstack-wrapper/tsconfig.json create mode 100644 openstack-wrapper/tslint.json diff --git a/openstack-wrapper/tsconfig.json b/openstack-wrapper/tsconfig.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstack-wrapper/tslint.json b/openstack-wrapper/tslint.json new file mode 100644 index 0000000000..e69de29bb2 From a57d336c019ff9bcd83ac5618e55345335b36f58 Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Mon, 14 Aug 2017 11:57:10 +0800 Subject: [PATCH 3/6] openstack-wrapper types added --- openstack-wrapper/index.d.ts | 270 ----------------- openstack-wrapper/openstack-wrapper-tests.ts | 3 - openstack-wrapper/tsconfig.json | 0 openstack-wrapper/tslint.json | 0 types/openstack-wrapper/index.d.ts | 274 ++++++++++++++++++ .../openstack-wrapper-tests.ts | 7 + types/openstack-wrapper/tsconfig.json | 22 ++ 7 files changed, 303 insertions(+), 273 deletions(-) delete mode 100644 openstack-wrapper/index.d.ts delete mode 100644 openstack-wrapper/openstack-wrapper-tests.ts delete mode 100644 openstack-wrapper/tsconfig.json delete mode 100644 openstack-wrapper/tslint.json create mode 100644 types/openstack-wrapper/index.d.ts create mode 100644 types/openstack-wrapper/openstack-wrapper-tests.ts create mode 100644 types/openstack-wrapper/tsconfig.json diff --git a/openstack-wrapper/index.d.ts b/openstack-wrapper/index.d.ts deleted file mode 100644 index e2c41db48f..0000000000 --- a/openstack-wrapper/index.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -// Type definitions for openstack-wrapper 2.1.6 -// Project: https://www.npmjs.com/package/openstack-wrapper -// Definitions by: Sanjay Madane -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 -export interface RequestOption{ - uri?: string; - headers?: any, - json?: any, - timeout?: any, - metricRequestID?: string, - metricUserName?: string, - metricLogger?: any -} - -export class Glance { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any); - setRequestID(request_id: any); - setUserName(user_name: string); - setLogger(logger: any); - setRequest(request_lib: any); - setMangler(mangle_lib: any); - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listImages(cb: Function); - getImage(id: any, cb: Function); - queueImage(data: any, cb: Function); - uploadImage(id: any, stream: any, cb: Function); - updateImage(id: any, data: any, cb: Function); - removeImage(id: any, cb: Function); -} - -export class Keystone { - request: any; - mangler:any; - mangleObject:any; - url:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string); - - setTimeout(new_timeout: any); - setRequestID(request_id: any); - setUserName(user_name: string); - setLogger(logger: any); - setRequest(request_lib: any); - setMangler(mangle_lib: any); - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - getToken(username: string, password: string, cb: Function); - getProjectTokenForReal(auth_data: any, cb: Function); - getProjectToken(access_token:any, project_id:any, cb: Function); - getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function); - listProjects(admin_access_token: any, cb: Function); - listUserProjects(username:any, access_token: any, cb: Function); - getProjectByName(admin_access_token: any, project_name:any, cb: Function); - listRoles(project_token:any, cb: Function); - listRoleAssignments(project_token:any, project_id:any, cb: Function); - addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function); - removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function); - listMetaEnvironments(auth_token:any, cb: Function); - listMetaOwningGroups(auth_token:any, cb: Function); - listProjectMeta(project_token:any, project_id:any, cb: Function); - updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function); -} - -export class Neutron { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any); - setRequestID(request_id: any); - setUserName(user_name: string); - setLogger(logger: any); - setRequest(request_lib: any); - setMangler(mangle_lib: any); - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listNetworks(cb: Function); - getNetwork(network_id:string, cb: Function); - listSubnets(cb: Function); - getSubnet(subnet_id:any, cb: Function); - listRouters(cb: Function); - getRouter(router_id:any, cb: Function); - createFloatingIp(floating_network_id:any, cb: Function); - listFloatingIps(options:any, cb: Function); - getFloatingIp(ip_id:any, cb: Function); - updateFloatingIp(ip_id:any, port_id:any,cb: Function); - removeFloatingIp(ip_id:any, cb: Function); - listPorts(options:any, cb: Function); - getPort(port_id:any,cb: Function); - updatePort(port_id:any, data:any, cb: Function); - listSecurityGroups(project_id:any, cb: Function); - getSecurityGroup(group_id:any, cb: Function); - createSecurityGroup(group_name:any, data:any, cb: Function); - updateSecurityGroup(group_id:any, data:any, cb: Function); - removeSecurityGroup(group_id:any, cb: Function); - listSecurityGroupRules(cb: Function); - getSecurityGroupRule(rule_id:any, cb: Function); - createSecurityGroupRule(group_id:any, data:any, cb: Function); - removeSecurityGroupRule(rule_id:any, cb: Function); - listLoadBalancers(cb: Function); - getLoadBalancer(lb_id:any, cb: Function); - createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function); - updateLoadBalancer(lb_id:any, data:any, cb: Function); - removeLoadBalancer(lb_id:any, cb: Function); - listLBListeners(cb: Function); - getLBListener(lb_id:any, cb: Function); - createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function); - updateLBListener(listener_id:any, data:any, cb: Function); - removeLBListener(listener_id:any, cb: Function); - listLBPools(cb: Function); - getLBPool(pool_id:any, cb: Function); - createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function); - updateLBPool(pool_id:any, data:any, cb: Function); - removeLBPool(pool_id:any, cb: Function); - listLBPoolMembers(pool_id:any, cb: Function); - getLBPoolMember(pool_id:any, member_id:any, cb: Function); - createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function); - updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function); - removeLBPoolMember(pool_id:any, member_id:any, cb: Function); - listLBHealthMonitors(cb: Function); - getLBHealthMonitor(health_monitor_id:any, cb: Function); - createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function); - updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function); - removeLBHealthMonitor(health_monitor_id:any, cb: Function); - getLBStats(lb_id:any, cb: Function); -} - -export class Octavia { - url:any; - token:any; - timeout:any; - request_id:any; - user_name:string; - logger:any; - retries: number; - retry_delay: number; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any); - setRequestID(request_id: any); - setUserName(user_name: string); - setLogger(logger: any); - setRequest(request_lib: any); - setRetries(retries:number); - setRetryDelay(retry_delay:number); - getRequestOptions(path: string, json_value:any):RequestOption; - listLoadBalancers(cb:Function); - getLoadBalancer(lb_id: string, cb:Function); - createLoadBalancer(project_id:string, data:any,cb:Function); - updateLoadBalancer(lb_id:string, data:any,cb:Function); - removeLoadBalancer(lb_id:string, cb:Function); - listLBListeners(cb:Function); - getLBListener(listener_id: string, cb:Function); - createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function); - updateLBListener(listener_id:string, data:any,cb:Function); - removeLBListener(listener_id: string, cb:Function); - listLBPools(cb:Function); - getLBPool(pool_id: string, cb:Function); - createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function); - updateLBPool(pool_id:string, data:any,cb:Function); - removeLBPool(pool_id:string, cb:Function); - listLBPoolMembers(pool_id:string, cb:Function); - getLBPoolMember(pool_id:string, member_id:string,cb:Function); - createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function); - updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function); - removeLBPoolMember(pool_id:string, member_id:string,cb:Function); - listLBHealthMonitors(cb:Function); - getLBHealthMonitor(health_monitor_id:string,cb:Function); - createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function); - updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function); - removeLBHealthMonitor(health_monitor_id:string,cb:Function); - getLBStats(lb_id:string,cb:Function); -} - -export class Nova { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any); - setRequestID(request_id: any); - setUserName(user_name: string); - setLogger(logger: any); - setRequest(request_lib: any); - setMangler(mangle_lib: any); - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listServers(cb:Function); - getServer(id:string, cb:Function); - createServer(data:any, cb:Function); - renameServer(id:string, name:string, cb:Function); - resizeServer(id:string, flavor:any,cb:Function); - confirmResizeServer(id: string, cb:Function); - revertResizeServer(id:string, cb:Function); - removeServer(id:string,cb:Function); - rebootServer(id:string, cb:Function); - forceRebootServer(id: string, cb:Function); - stopServer(id: string, cb:Function); - startServer(id: string, cb:Function); - pauseServer(id: string, cb:Function); - suspendServer(id: string, cb:Function); - resumeServer(is: string, cb:Function); - getServerConsoleURL(type: any, id: string, cb:Function); - getServerLog(id: string, length: any, cb:Function); - createServerImage(id: string , data: any,cb:Function); - setServerMetadata(id: string , data: any,cb:Function); - listFlavors(cb:Function); - getFlavor(id: string ,cb:Function); - listFloatingIps(cb:Function); - getFloatingIp(id: string, cb:Function); - createFloatingIp(data: any,cb:Function); - removeFloatingIp(id: string, cb:Function); - associateFloatingIp(instance_id:any, ip_address: any,cb:Function); - disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function); - listFloatingIpPools(cb:Function); - getFloatingIpPool(id: string, cb:Function); - listAvailabilityZones(cb:Function); - getAvailabilityZone(id: string, cb:Function); - listKeyPairs(cb:Function); - getKeyPair(id: string, cb:Function); - createKeyPair(name:string, public_key: any,cb:Function); - removeKeyPair(id:string,cb:Function); - getQuotaSet(project_id:string, cb:Function); - setQuotaSet(project_id:string, data: any,cb:Function); - getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function); - assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function); - removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function); - getImageMetaData(id:string, cb:Function); - setImageMetaData(id:string, data:any, cb:Function); -} - -export interface Project{ - general_token: string; - project_token: string; - glance: Glance; - neutron: Neutron; - nova: Nova; - octavia: Octavia; -} - -export class getSimpleProject{ - constructor(username: string, password: string, project_id: string, keystone_url: string, cb: Function); -} \ No newline at end of file diff --git a/openstack-wrapper/openstack-wrapper-tests.ts b/openstack-wrapper/openstack-wrapper-tests.ts deleted file mode 100644 index 467948047c..0000000000 --- a/openstack-wrapper/openstack-wrapper-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as openstack from 'openstack-wrapper'; - -const nova = new Glance("",""); \ No newline at end of file diff --git a/openstack-wrapper/tsconfig.json b/openstack-wrapper/tsconfig.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openstack-wrapper/tslint.json b/openstack-wrapper/tslint.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/types/openstack-wrapper/index.d.ts b/types/openstack-wrapper/index.d.ts new file mode 100644 index 0000000000..584b5a57c2 --- /dev/null +++ b/types/openstack-wrapper/index.d.ts @@ -0,0 +1,274 @@ +// Type definitions for openstack-wrapper 2.1.6 +// Project: https://www.npmjs.com/package/openstack-wrapper +// Definitions by: Sanjay Madane +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare module "openstack-wrapper" { + export interface RequestOption{ + uri?: string; + headers?: any, + json?: any, + timeout?: any, + metricRequestID?: string, + metricUserName?: string, + metricLogger?: any + } + + export class Glance { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listImages(cb: Function):any; + getImage(id: any, cb: Function):any; + queueImage(data: any, cb: Function):any; + uploadImage(id: any, stream: any, cb: Function):any; + updateImage(id: any, data: any, cb: Function):any; + removeImage(id: any, cb: Function):any; + } + + export class Keystone { + request: any; + mangler:any; + mangleObject:any; + url:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string); + + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + getToken(username: string, password: string, cb: Function):any; + getProjectTokenForReal(auth_data: any, cb: Function):any; + getProjectToken(access_token:any, project_id:any, cb: Function):any; + getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function):any; + listProjects(admin_access_token: any, cb: Function):any; + listUserProjects(username:any, access_token: any, cb: Function):any; + getProjectByName(admin_access_token: any, project_name:any, cb: Function):any; + listRoles(project_token:any, cb: Function):any; + listRoleAssignments(project_token:any, project_id:any, cb: Function):any; + addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; + removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; + listMetaEnvironments(auth_token:any, cb: Function):any; + listMetaOwningGroups(auth_token:any, cb: Function):any; + listProjectMeta(project_token:any, project_id:any, cb: Function):any; + updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function):any; + } + + export class Neutron { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listNetworks(cb: Function):any; + getNetwork(network_id:string, cb: Function):any; + listSubnets(cb: Function):any; + getSubnet(subnet_id:any, cb: Function):any; + listRouters(cb: Function):any; + getRouter(router_id:any, cb: Function):any; + createFloatingIp(floating_network_id:any, cb: Function):any; + listFloatingIps(options:any, cb: Function):any; + getFloatingIp(ip_id:any, cb: Function):any; + updateFloatingIp(ip_id:any, port_id:any,cb: Function):any; + removeFloatingIp(ip_id:any, cb: Function):any; + listPorts(options:any, cb: Function):any; + getPort(port_id:any,cb: Function):any; + updatePort(port_id:any, data:any, cb: Function):any; + listSecurityGroups(project_id:any, cb: Function):any; + getSecurityGroup(group_id:any, cb: Function):any; + createSecurityGroup(group_name:any, data:any, cb: Function):any; + updateSecurityGroup(group_id:any, data:any, cb: Function):any; + removeSecurityGroup(group_id:any, cb: Function):any; + listSecurityGroupRules(cb: Function):any; + getSecurityGroupRule(rule_id:any, cb: Function):any; + createSecurityGroupRule(group_id:any, data:any, cb: Function):any; + removeSecurityGroupRule(rule_id:any, cb: Function):any; + listLoadBalancers(cb: Function):any; + getLoadBalancer(lb_id:any, cb: Function):any; + createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function):any; + updateLoadBalancer(lb_id:any, data:any, cb: Function):any; + removeLoadBalancer(lb_id:any, cb: Function):any; + listLBListeners(cb: Function):any; + getLBListener(lb_id:any, cb: Function):any; + createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function):any; + updateLBListener(listener_id:any, data:any, cb: Function):any; + removeLBListener(listener_id:any, cb: Function):any; + listLBPools(cb: Function):any; + getLBPool(pool_id:any, cb: Function):any; + createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function):any; + updateLBPool(pool_id:any, data:any, cb: Function):any; + removeLBPool(pool_id:any, cb: Function):any; + listLBPoolMembers(pool_id:any, cb: Function):any; + getLBPoolMember(pool_id:any, member_id:any, cb: Function):any; + createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function):any; + updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function):any; + removeLBPoolMember(pool_id:any, member_id:any, cb: Function):any; + listLBHealthMonitors(cb: Function):any; + getLBHealthMonitor(health_monitor_id:any, cb: Function):any; + createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function):any; + updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function):any; + removeLBHealthMonitor(health_monitor_id:any, cb: Function):any; + getLBStats(lb_id:any, cb: Function):any; + } + + export class Octavia { + url:any; + token:any; + timeout:any; + request_id:any; + user_name:string; + logger:any; + retries: number; + retry_delay: number; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setRetries(retries:number):void; + setRetryDelay(retry_delay:number):void; + getRequestOptions(path: string, json_value:any):RequestOption; + listLoadBalancers(cb:Function):any; + getLoadBalancer(lb_id: string, cb:Function):any; + createLoadBalancer(project_id:string, data:any,cb:Function):any; + updateLoadBalancer(lb_id:string, data:any,cb:Function):any; + removeLoadBalancer(lb_id:string, cb:Function):any; + listLBListeners(cb:Function):any; + getLBListener(listener_id: string, cb:Function):any; + createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function):any; + updateLBListener(listener_id:string, data:any,cb:Function):any; + removeLBListener(listener_id: string, cb:Function):any; + listLBPools(cb:Function):any; + getLBPool(pool_id: string, cb:Function):any; + createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function):any; + updateLBPool(pool_id:string, data:any,cb:Function):any; + removeLBPool(pool_id:string, cb:Function):any; + listLBPoolMembers(pool_id:string, cb:Function):any; + getLBPoolMember(pool_id:string, member_id:string,cb:Function):any; + createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function):any; + updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function):any; + removeLBPoolMember(pool_id:string, member_id:string,cb:Function):any; + listLBHealthMonitors(cb:Function):any; + getLBHealthMonitor(health_monitor_id:string,cb:Function):any; + createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function):any; + updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function):any; + removeLBHealthMonitor(health_monitor_id:string,cb:Function):any; + getLBStats(lb_id:string,cb:Function):any; + } + + export class Nova { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listServers(cb:Function):any; + getServer(id:string, cb:Function):any; + createServer(data:any, cb:Function):any; + renameServer(id:string, name:string, cb:Function):any; + resizeServer(id:string, flavor:any,cb:Function):any; + confirmResizeServer(id: string, cb:Function):any; + revertResizeServer(id:string, cb:Function):any; + removeServer(id:string,cb:Function):any; + rebootServer(id:string, cb:Function):any; + forceRebootServer(id: string, cb:Function):any; + stopServer(id: string, cb:Function):any; + startServer(id: string, cb:Function):any; + pauseServer(id: string, cb:Function):any; + suspendServer(id: string, cb:Function):any; + resumeServer(is: string, cb:Function):any; + getServerConsoleURL(type: any, id: string, cb:Function):any; + getServerLog(id: string, length: any, cb:Function):any; + createServerImage(id: string , data: any,cb:Function):any; + setServerMetadata(id: string , data: any,cb:Function):any; + listFlavors(cb:Function):any; + getFlavor(id: string ,cb:Function):any; + listFloatingIps(cb:Function):any; + getFloatingIp(id: string, cb:Function):any; + createFloatingIp(data: any,cb:Function):any; + removeFloatingIp(id: string, cb:Function):any; + associateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; + disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; + listFloatingIpPools(cb:Function):any; + getFloatingIpPool(id: string, cb:Function):any; + listAvailabilityZones(cb:Function):any; + getAvailabilityZone(id: string, cb:Function):any; + listKeyPairs(cb:Function):any; + getKeyPair(id: string, cb:Function):any; + createKeyPair(name:string, public_key: any,cb:Function):any; + removeKeyPair(id:string,cb:Function):any; + getQuotaSet(project_id:string, cb:Function):any; + setQuotaSet(project_id:string, data: any,cb:Function):any; + getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function):any; + assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function):any; + removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function):any; + getImageMetaData(id:string, cb:Function):any; + setImageMetaData(id:string, data:any, cb:Function):any; + } + + export interface Project{ + general_token: string; + project_token: string; + glance: Glance; + neutron: Neutron; + nova: Nova; + octavia: Octavia; + } + + export class getSimpleProject{ + constructor(username: string, password: string, project_id: string, keystone_url: string, cb: Function); + } +} +export default "openstack-wrapper" \ No newline at end of file diff --git a/types/openstack-wrapper/openstack-wrapper-tests.ts b/types/openstack-wrapper/openstack-wrapper-tests.ts new file mode 100644 index 0000000000..a64dabcef8 --- /dev/null +++ b/types/openstack-wrapper/openstack-wrapper-tests.ts @@ -0,0 +1,7 @@ +import * as OSWrap from 'openstack-wrapper'; + +const keystone = new OSWrap.Keystone("endpoint-url"); +const glance = new OSWrap.Glance("endpoint-url","auth-token"); +const neutron = new OSWrap.Neutron("endpoint-url","auth-token"); +const octavia = new OSWrap.Octavia("endpoint-url","auth-token"); +const nova = new OSWrap.Nova("endpoint-url","auth-token"); \ No newline at end of file diff --git a/types/openstack-wrapper/tsconfig.json b/types/openstack-wrapper/tsconfig.json new file mode 100644 index 0000000000..0ccc091222 --- /dev/null +++ b/types/openstack-wrapper/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openstack-wrapper-tests.ts" + ] +} \ No newline at end of file From d8356c7e970b881034a05fae17111f4088a2fbc8 Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Tue, 15 Aug 2017 11:20:21 +0800 Subject: [PATCH 4/6] Review comments addressed --- types/openstack-wrapper/index.d.ts | 528 ++++++++++++++--------------- 1 file changed, 261 insertions(+), 267 deletions(-) diff --git a/types/openstack-wrapper/index.d.ts b/types/openstack-wrapper/index.d.ts index 584b5a57c2..e656e25d4a 100644 --- a/types/openstack-wrapper/index.d.ts +++ b/types/openstack-wrapper/index.d.ts @@ -4,271 +4,265 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -declare module "openstack-wrapper" { - export interface RequestOption{ - uri?: string; - headers?: any, - json?: any, - timeout?: any, - metricRequestID?: string, - metricUserName?: string, - metricLogger?: any - } - - export class Glance { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listImages(cb: Function):any; - getImage(id: any, cb: Function):any; - queueImage(data: any, cb: Function):any; - uploadImage(id: any, stream: any, cb: Function):any; - updateImage(id: any, data: any, cb: Function):any; - removeImage(id: any, cb: Function):any; - } - - export class Keystone { - request: any; - mangler:any; - mangleObject:any; - url:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string); - - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - getToken(username: string, password: string, cb: Function):any; - getProjectTokenForReal(auth_data: any, cb: Function):any; - getProjectToken(access_token:any, project_id:any, cb: Function):any; - getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function):any; - listProjects(admin_access_token: any, cb: Function):any; - listUserProjects(username:any, access_token: any, cb: Function):any; - getProjectByName(admin_access_token: any, project_name:any, cb: Function):any; - listRoles(project_token:any, cb: Function):any; - listRoleAssignments(project_token:any, project_id:any, cb: Function):any; - addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; - removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; - listMetaEnvironments(auth_token:any, cb: Function):any; - listMetaOwningGroups(auth_token:any, cb: Function):any; - listProjectMeta(project_token:any, project_id:any, cb: Function):any; - updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function):any; - } - - export class Neutron { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listNetworks(cb: Function):any; - getNetwork(network_id:string, cb: Function):any; - listSubnets(cb: Function):any; - getSubnet(subnet_id:any, cb: Function):any; - listRouters(cb: Function):any; - getRouter(router_id:any, cb: Function):any; - createFloatingIp(floating_network_id:any, cb: Function):any; - listFloatingIps(options:any, cb: Function):any; - getFloatingIp(ip_id:any, cb: Function):any; - updateFloatingIp(ip_id:any, port_id:any,cb: Function):any; - removeFloatingIp(ip_id:any, cb: Function):any; - listPorts(options:any, cb: Function):any; - getPort(port_id:any,cb: Function):any; - updatePort(port_id:any, data:any, cb: Function):any; - listSecurityGroups(project_id:any, cb: Function):any; - getSecurityGroup(group_id:any, cb: Function):any; - createSecurityGroup(group_name:any, data:any, cb: Function):any; - updateSecurityGroup(group_id:any, data:any, cb: Function):any; - removeSecurityGroup(group_id:any, cb: Function):any; - listSecurityGroupRules(cb: Function):any; - getSecurityGroupRule(rule_id:any, cb: Function):any; - createSecurityGroupRule(group_id:any, data:any, cb: Function):any; - removeSecurityGroupRule(rule_id:any, cb: Function):any; - listLoadBalancers(cb: Function):any; - getLoadBalancer(lb_id:any, cb: Function):any; - createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function):any; - updateLoadBalancer(lb_id:any, data:any, cb: Function):any; - removeLoadBalancer(lb_id:any, cb: Function):any; - listLBListeners(cb: Function):any; - getLBListener(lb_id:any, cb: Function):any; - createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function):any; - updateLBListener(listener_id:any, data:any, cb: Function):any; - removeLBListener(listener_id:any, cb: Function):any; - listLBPools(cb: Function):any; - getLBPool(pool_id:any, cb: Function):any; - createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function):any; - updateLBPool(pool_id:any, data:any, cb: Function):any; - removeLBPool(pool_id:any, cb: Function):any; - listLBPoolMembers(pool_id:any, cb: Function):any; - getLBPoolMember(pool_id:any, member_id:any, cb: Function):any; - createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function):any; - updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function):any; - removeLBPoolMember(pool_id:any, member_id:any, cb: Function):any; - listLBHealthMonitors(cb: Function):any; - getLBHealthMonitor(health_monitor_id:any, cb: Function):any; - createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function):any; - updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function):any; - removeLBHealthMonitor(health_monitor_id:any, cb: Function):any; - getLBStats(lb_id:any, cb: Function):any; - } - - export class Octavia { - url:any; - token:any; - timeout:any; - request_id:any; - user_name:string; - logger:any; - retries: number; - retry_delay: number; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setRetries(retries:number):void; - setRetryDelay(retry_delay:number):void; - getRequestOptions(path: string, json_value:any):RequestOption; - listLoadBalancers(cb:Function):any; - getLoadBalancer(lb_id: string, cb:Function):any; - createLoadBalancer(project_id:string, data:any,cb:Function):any; - updateLoadBalancer(lb_id:string, data:any,cb:Function):any; - removeLoadBalancer(lb_id:string, cb:Function):any; - listLBListeners(cb:Function):any; - getLBListener(listener_id: string, cb:Function):any; - createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function):any; - updateLBListener(listener_id:string, data:any,cb:Function):any; - removeLBListener(listener_id: string, cb:Function):any; - listLBPools(cb:Function):any; - getLBPool(pool_id: string, cb:Function):any; - createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function):any; - updateLBPool(pool_id:string, data:any,cb:Function):any; - removeLBPool(pool_id:string, cb:Function):any; - listLBPoolMembers(pool_id:string, cb:Function):any; - getLBPoolMember(pool_id:string, member_id:string,cb:Function):any; - createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function):any; - updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function):any; - removeLBPoolMember(pool_id:string, member_id:string,cb:Function):any; - listLBHealthMonitors(cb:Function):any; - getLBHealthMonitor(health_monitor_id:string,cb:Function):any; - createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function):any; - updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function):any; - removeLBHealthMonitor(health_monitor_id:string,cb:Function):any; - getLBStats(lb_id:string,cb:Function):any; - } - - export class Nova { - request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; - - constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listServers(cb:Function):any; - getServer(id:string, cb:Function):any; - createServer(data:any, cb:Function):any; - renameServer(id:string, name:string, cb:Function):any; - resizeServer(id:string, flavor:any,cb:Function):any; - confirmResizeServer(id: string, cb:Function):any; - revertResizeServer(id:string, cb:Function):any; - removeServer(id:string,cb:Function):any; - rebootServer(id:string, cb:Function):any; - forceRebootServer(id: string, cb:Function):any; - stopServer(id: string, cb:Function):any; - startServer(id: string, cb:Function):any; - pauseServer(id: string, cb:Function):any; - suspendServer(id: string, cb:Function):any; - resumeServer(is: string, cb:Function):any; - getServerConsoleURL(type: any, id: string, cb:Function):any; - getServerLog(id: string, length: any, cb:Function):any; - createServerImage(id: string , data: any,cb:Function):any; - setServerMetadata(id: string , data: any,cb:Function):any; - listFlavors(cb:Function):any; - getFlavor(id: string ,cb:Function):any; - listFloatingIps(cb:Function):any; - getFloatingIp(id: string, cb:Function):any; - createFloatingIp(data: any,cb:Function):any; - removeFloatingIp(id: string, cb:Function):any; - associateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; - disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; - listFloatingIpPools(cb:Function):any; - getFloatingIpPool(id: string, cb:Function):any; - listAvailabilityZones(cb:Function):any; - getAvailabilityZone(id: string, cb:Function):any; - listKeyPairs(cb:Function):any; - getKeyPair(id: string, cb:Function):any; - createKeyPair(name:string, public_key: any,cb:Function):any; - removeKeyPair(id:string,cb:Function):any; - getQuotaSet(project_id:string, cb:Function):any; - setQuotaSet(project_id:string, data: any,cb:Function):any; - getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function):any; - assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function):any; - removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function):any; - getImageMetaData(id:string, cb:Function):any; - setImageMetaData(id:string, data:any, cb:Function):any; - } - - export interface Project{ - general_token: string; - project_token: string; - glance: Glance; - neutron: Neutron; - nova: Nova; - octavia: Octavia; - } - - export class getSimpleProject{ - constructor(username: string, password: string, project_id: string, keystone_url: string, cb: Function); - } +export interface RequestOption{ + uri?: string; + headers?: any, + json?: any, + timeout?: any, + metricRequestID?: string, + metricUserName?: string, + metricLogger?: any } -export default "openstack-wrapper" \ No newline at end of file +export interface Project{ + general_token: string; + project_token: string; + glance: Glance; + neutron: Neutron; + nova: Nova; + octavia: Octavia; +} + +export function getSimpleProject(username: string, password: string, project_id: string, keystone_url: string, cb: Function):void; + +export class Nova { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listServers(cb:Function):any; + getServer(id:string, cb:Function):any; + createServer(data:any, cb:Function):any; + renameServer(id:string, name:string, cb:Function):any; + resizeServer(id:string, flavor:any,cb:Function):any; + confirmResizeServer(id: string, cb:Function):any; + revertResizeServer(id:string, cb:Function):any; + removeServer(id:string,cb:Function):any; + rebootServer(id:string, cb:Function):any; + forceRebootServer(id: string, cb:Function):any; + stopServer(id: string, cb:Function):any; + startServer(id: string, cb:Function):any; + pauseServer(id: string, cb:Function):any; + suspendServer(id: string, cb:Function):any; + resumeServer(is: string, cb:Function):any; + getServerConsoleURL(type: any, id: string, cb:Function):any; + getServerLog(id: string, length: any, cb:Function):any; + createServerImage(id: string , data: any,cb:Function):any; + setServerMetadata(id: string , data: any,cb:Function):any; + listFlavors(cb:Function):any; + getFlavor(id: string ,cb:Function):any; + listFloatingIps(cb:Function):any; + getFloatingIp(id: string, cb:Function):any; + createFloatingIp(data: any,cb:Function):any; + removeFloatingIp(id: string, cb:Function):any; + associateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; + disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; + listFloatingIpPools(cb:Function):any; + getFloatingIpPool(id: string, cb:Function):any; + listAvailabilityZones(cb:Function):any; + getAvailabilityZone(id: string, cb:Function):any; + listKeyPairs(cb:Function):any; + getKeyPair(id: string, cb:Function):any; + createKeyPair(name:string, public_key: any,cb:Function):any; + removeKeyPair(id:string,cb:Function):any; + getQuotaSet(project_id:string, cb:Function):any; + setQuotaSet(project_id:string, data: any,cb:Function):any; + getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function):any; + assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function):any; + removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function):any; + getImageMetaData(id:string, cb:Function):any; + setImageMetaData(id:string, data:any, cb:Function):any; +} + +export class Glance { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listImages(cb: Function):any; + getImage(id: any, cb: Function):any; + queueImage(data: any, cb: Function):any; + uploadImage(id: any, stream: any, cb: Function):any; + updateImage(id: any, data: any, cb: Function):any; + removeImage(id: any, cb: Function):any; +} + +export class Keystone { + request: any; + mangler:any; + mangleObject:any; + url:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string); + + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + getToken(username: string, password: string, cb: Function):any; + getProjectTokenForReal(auth_data: any, cb: Function):any; + getProjectToken(access_token:any, project_id:any, cb: Function):any; + getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function):any; + listProjects(admin_access_token: any, cb: Function):any; + listUserProjects(username:any, access_token: any, cb: Function):any; + getProjectByName(admin_access_token: any, project_name:any, cb: Function):any; + listRoles(project_token:any, cb: Function):any; + listRoleAssignments(project_token:any, project_id:any, cb: Function):any; + addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; + removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; + listMetaEnvironments(auth_token:any, cb: Function):any; + listMetaOwningGroups(auth_token:any, cb: Function):any; + listProjectMeta(project_token:any, project_id:any, cb: Function):any; + updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function):any; +} + +export class Neutron { + request: any; + mangler:any; + mangleObject:any; + url:any; + token:any; + timeout:any; + request_id:any; + user_name:any; + logger:any; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setMangler(mangle_lib: any):void; + getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; + listNetworks(cb: Function):any; + getNetwork(network_id:string, cb: Function):any; + listSubnets(cb: Function):any; + getSubnet(subnet_id:any, cb: Function):any; + listRouters(cb: Function):any; + getRouter(router_id:any, cb: Function):any; + createFloatingIp(floating_network_id:any, cb: Function):any; + listFloatingIps(options:any, cb: Function):any; + getFloatingIp(ip_id:any, cb: Function):any; + updateFloatingIp(ip_id:any, port_id:any,cb: Function):any; + removeFloatingIp(ip_id:any, cb: Function):any; + listPorts(options:any, cb: Function):any; + getPort(port_id:any,cb: Function):any; + updatePort(port_id:any, data:any, cb: Function):any; + listSecurityGroups(project_id:any, cb: Function):any; + getSecurityGroup(group_id:any, cb: Function):any; + createSecurityGroup(group_name:any, data:any, cb: Function):any; + updateSecurityGroup(group_id:any, data:any, cb: Function):any; + removeSecurityGroup(group_id:any, cb: Function):any; + listSecurityGroupRules(cb: Function):any; + getSecurityGroupRule(rule_id:any, cb: Function):any; + createSecurityGroupRule(group_id:any, data:any, cb: Function):any; + removeSecurityGroupRule(rule_id:any, cb: Function):any; + listLoadBalancers(cb: Function):any; + getLoadBalancer(lb_id:any, cb: Function):any; + createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function):any; + updateLoadBalancer(lb_id:any, data:any, cb: Function):any; + removeLoadBalancer(lb_id:any, cb: Function):any; + listLBListeners(cb: Function):any; + getLBListener(lb_id:any, cb: Function):any; + createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function):any; + updateLBListener(listener_id:any, data:any, cb: Function):any; + removeLBListener(listener_id:any, cb: Function):any; + listLBPools(cb: Function):any; + getLBPool(pool_id:any, cb: Function):any; + createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function):any; + updateLBPool(pool_id:any, data:any, cb: Function):any; + removeLBPool(pool_id:any, cb: Function):any; + listLBPoolMembers(pool_id:any, cb: Function):any; + getLBPoolMember(pool_id:any, member_id:any, cb: Function):any; + createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function):any; + updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function):any; + removeLBPoolMember(pool_id:any, member_id:any, cb: Function):any; + listLBHealthMonitors(cb: Function):any; + getLBHealthMonitor(health_monitor_id:any, cb: Function):any; + createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function):any; + updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function):any; + removeLBHealthMonitor(health_monitor_id:any, cb: Function):any; + getLBStats(lb_id:any, cb: Function):any; +} + +export class Octavia { + url:any; + token:any; + timeout:any; + request_id:any; + user_name:string; + logger:any; + retries: number; + retry_delay: number; + + constructor(endpoint_url: string, auth_token: string); + setTimeout(new_timeout: any):void; + setRequestID(request_id: any):void; + setUserName(user_name: string):void; + setLogger(logger: any):void; + setRequest(request_lib: any):void; + setRetries(retries:number):void; + setRetryDelay(retry_delay:number):void; + getRequestOptions(path: string, json_value:any):RequestOption; + listLoadBalancers(cb:Function):any; + getLoadBalancer(lb_id: string, cb:Function):any; + createLoadBalancer(project_id:string, data:any,cb:Function):any; + updateLoadBalancer(lb_id:string, data:any,cb:Function):any; + removeLoadBalancer(lb_id:string, cb:Function):any; + listLBListeners(cb:Function):any; + getLBListener(listener_id: string, cb:Function):any; + createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function):any; + updateLBListener(listener_id:string, data:any,cb:Function):any; + removeLBListener(listener_id: string, cb:Function):any; + listLBPools(cb:Function):any; + getLBPool(pool_id: string, cb:Function):any; + createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function):any; + updateLBPool(pool_id:string, data:any,cb:Function):any; + removeLBPool(pool_id:string, cb:Function):any; + listLBPoolMembers(pool_id:string, cb:Function):any; + getLBPoolMember(pool_id:string, member_id:string,cb:Function):any; + createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function):any; + updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function):any; + removeLBPoolMember(pool_id:string, member_id:string,cb:Function):any; + listLBHealthMonitors(cb:Function):any; + getLBHealthMonitor(health_monitor_id:string,cb:Function):any; + createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function):any; + updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function):any; + removeLBHealthMonitor(health_monitor_id:string,cb:Function):any; + getLBStats(lb_id:string,cb:Function):any; +} \ No newline at end of file From c8e6e26515139a23cfc8bbdc300c9e15a60afcb5 Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Wed, 16 Aug 2017 11:23:35 +0800 Subject: [PATCH 5/6] tslint.json added and resolved lint errors --- types/openstack-wrapper/index.d.ts | 445 +++++++++--------- .../openstack-wrapper-tests.ts | 8 +- types/openstack-wrapper/tslint.json | 4 + 3 files changed, 231 insertions(+), 226 deletions(-) create mode 100644 types/openstack-wrapper/tslint.json diff --git a/types/openstack-wrapper/index.d.ts b/types/openstack-wrapper/index.d.ts index e656e25d4a..8c92747d21 100644 --- a/types/openstack-wrapper/index.d.ts +++ b/types/openstack-wrapper/index.d.ts @@ -1,19 +1,20 @@ -// Type definitions for openstack-wrapper 2.1.6 +// Type definitions for openstack-wrapper 2.1 // Project: https://www.npmjs.com/package/openstack-wrapper // Definitions by: Sanjay Madane // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -export interface RequestOption{ +export interface RequestOption { uri?: string; - headers?: any, - json?: any, - timeout?: any, - metricRequestID?: string, - metricUserName?: string, - metricLogger?: any + headers?: any; + json?: any; + timeout?: any; + metricRequestID?: string; + metricUserName?: string; + metricLogger?: any; } -export interface Project{ + +export interface Project { general_token: string; project_token: string; glance: Glance; @@ -22,247 +23,247 @@ export interface Project{ octavia: Octavia; } -export function getSimpleProject(username: string, password: string, project_id: string, keystone_url: string, cb: Function):void; +export function getSimpleProject(username: string, password: string, project_id: string, keystone_url: string, cb: (...args: any[]) => any): void; export class Nova { request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; + mangler: any; + mangleObject: any; + url: any; + token: any; + timeout: any; + request_id: any; + user_name: any; + logger: any; constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listServers(cb:Function):any; - getServer(id:string, cb:Function):any; - createServer(data:any, cb:Function):any; - renameServer(id:string, name:string, cb:Function):any; - resizeServer(id:string, flavor:any,cb:Function):any; - confirmResizeServer(id: string, cb:Function):any; - revertResizeServer(id:string, cb:Function):any; - removeServer(id:string,cb:Function):any; - rebootServer(id:string, cb:Function):any; - forceRebootServer(id: string, cb:Function):any; - stopServer(id: string, cb:Function):any; - startServer(id: string, cb:Function):any; - pauseServer(id: string, cb:Function):any; - suspendServer(id: string, cb:Function):any; - resumeServer(is: string, cb:Function):any; - getServerConsoleURL(type: any, id: string, cb:Function):any; - getServerLog(id: string, length: any, cb:Function):any; - createServerImage(id: string , data: any,cb:Function):any; - setServerMetadata(id: string , data: any,cb:Function):any; - listFlavors(cb:Function):any; - getFlavor(id: string ,cb:Function):any; - listFloatingIps(cb:Function):any; - getFloatingIp(id: string, cb:Function):any; - createFloatingIp(data: any,cb:Function):any; - removeFloatingIp(id: string, cb:Function):any; - associateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; - disassociateFloatingIp(instance_id:any, ip_address: any,cb:Function):any; - listFloatingIpPools(cb:Function):any; - getFloatingIpPool(id: string, cb:Function):any; - listAvailabilityZones(cb:Function):any; - getAvailabilityZone(id: string, cb:Function):any; - listKeyPairs(cb:Function):any; - getKeyPair(id: string, cb:Function):any; - createKeyPair(name:string, public_key: any,cb:Function):any; - removeKeyPair(id:string,cb:Function):any; - getQuotaSet(project_id:string, cb:Function):any; - setQuotaSet(project_id:string, data: any,cb:Function):any; - getTenantUsage(project_id:string, start_date_obj:any, end_date_obj: any,cb:Function):any; - assignSecurityGroup(security_group_name:string, instance_id:string, cb:Function):any; - removeSecurityGroup(security_group_name: string, instance_id:string, cb:Function):any; - getImageMetaData(id:string, cb:Function):any; - setImageMetaData(id:string, data:any, cb:Function):any; + setTimeout(new_timeout: any): void; + setRequestID(request_id: any): void; + setUserName(user_name: string): void; + setLogger(logger: any): void; + setRequest(request_lib: any): void; + setMangler(mangle_lib: any): void; + getRequestOptions(path: string, json_value: any, extra_headers: any): RequestOption; + listServers(cb: (...args: any[]) => any): any; + getServer(id: string, cb: (...args: any[]) => any): any; + createServer(data: any, cb: (...args: any[]) => any): any; + renameServer(id: string, name: string, cb: (...args: any[]) => any): any; + resizeServer(id: string, flavor: any, cb: (...args: any[]) => any): any; + confirmResizeServer(id: string, cb: (...args: any[]) => any): any; + revertResizeServer(id: string, cb: (...args: any[]) => any): any; + removeServer(id: string, cb: (...args: any[]) => any): any; + rebootServer(id: string, cb: (...args: any[]) => any): any; + forceRebootServer(id: string, cb: (...args: any[]) => any): any; + stopServer(id: string, cb: (...args: any[]) => any): any; + startServer(id: string, cb: (...args: any[]) => any): any; + pauseServer(id: string, cb: (...args: any[]) => any): any; + suspendServer(id: string, cb: (...args: any[]) => any): any; + resumeServer(is: string, cb: (...args: any[]) => any): any; + getServerConsoleURL(type: any, id: string, cb: (...args: any[]) => any): any; + getServerLog(id: string, length: any, cb: (...args: any[]) => any): any; + createServerImage(id: string , data: any, cb: (...args: any[]) => any): any; + setServerMetadata(id: string , data: any, cb: (...args: any[]) => any): any; + listFlavors(cb: (...args: any[]) => any): any; + getFlavor(id: string, cb: (...args: any[]) => any): any; + listFloatingIps(cb: (...args: any[]) => any): any; + getFloatingIp(id: string, cb: (...args: any[]) => any): any; + createFloatingIp(data: any, cb: (...args: any[]) => any): any; + removeFloatingIp(id: string, cb: (...args: any[]) => any): any; + associateFloatingIp(instance_id: any, ip_address: any, cb: (...args: any[]) => any): any; + disassociateFloatingIp(instance_id: any, ip_address: any, cb: (...args: any[]) => any): any; + listFloatingIpPools(cb: (...args: any[]) => any): any; + getFloatingIpPool(id: string, cb: (...args: any[]) => any): any; + listAvailabilityZones(cb: (...args: any[]) => any): any; + getAvailabilityZone(id: string, cb: (...args: any[]) => any): any; + listKeyPairs(cb: (...args: any[]) => any): any; + getKeyPair(id: string, cb: (...args: any[]) => any): any; + createKeyPair(name: string, public_key: any, cb: (...args: any[]) => any): any; + removeKeyPair(id: string, cb: (...args: any[]) => any): any; + getQuotaSet(project_id: string, cb: (...args: any[]) => any): any; + setQuotaSet(project_id: string, data: any, cb: (...args: any[]) => any): any; + getTenantUsage(project_id: string, start_date_obj: any, end_date_obj: any, cb: (...args: any[]) => any): any; + assignSecurityGroup(security_group_name: string, instance_id: string, cb: (...args: any[]) => any): any; + removeSecurityGroup(security_group_name: string, instance_id: string, cb: (...args: any[]) => any): any; + getImageMetaData(id: string, cb: (...args: any[]) => any): any; + setImageMetaData(id: string, data: any, cb: (...args: any[]) => any): any; } export class Glance { request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; + mangler: any; + mangleObject: any; + url: any; + token: any; + timeout: any; + request_id: any; + user_name: any; + logger: any; constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listImages(cb: Function):any; - getImage(id: any, cb: Function):any; - queueImage(data: any, cb: Function):any; - uploadImage(id: any, stream: any, cb: Function):any; - updateImage(id: any, data: any, cb: Function):any; - removeImage(id: any, cb: Function):any; + setTimeout(new_timeout: any): void; + setRequestID(request_id: any): void; + setUserName(user_name: string): void; + setLogger(logger: any): void; + setRequest(request_lib: any): void; + setMangler(mangle_lib: any): void; + getRequestOptions(path: string, json_value: any, extra_headers: any): RequestOption; + listImages(cb: (...args: any[]) => any): any; + getImage(id: any, cb: (...args: any[]) => any): any; + queueImage(data: any, cb: (...args: any[]) => any): any; + uploadImage(id: any, stream: any, cb: (...args: any[]) => any): any; + updateImage(id: any, data: any, cb: (...args: any[]) => any): any; + removeImage(id: any, cb: (...args: any[]) => any): any; } export class Keystone { request: any; - mangler:any; - mangleObject:any; - url:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; + mangler: any; + mangleObject: any; + url: any; + timeout: any; + request_id: any; + user_name: any; + logger: any; constructor(endpoint_url: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - getToken(username: string, password: string, cb: Function):any; - getProjectTokenForReal(auth_data: any, cb: Function):any; - getProjectToken(access_token:any, project_id:any, cb: Function):any; - getProjectTokenByName(access_token:any, domain_id:any, project_name:string, cb: Function):any; - listProjects(admin_access_token: any, cb: Function):any; - listUserProjects(username:any, access_token: any, cb: Function):any; - getProjectByName(admin_access_token: any, project_name:any, cb: Function):any; - listRoles(project_token:any, cb: Function):any; - listRoleAssignments(project_token:any, project_id:any, cb: Function):any; - addRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; - removeRoleAssignment(project_token:any, project_id:any, entry_id:any, entry_type:any, role_id: any, cb: Function):any; - listMetaEnvironments(auth_token:any, cb: Function):any; - listMetaOwningGroups(auth_token:any, cb: Function):any; - listProjectMeta(project_token:any, project_id:any, cb: Function):any; - updateProjectMeta(project_token:any, project_id:any,new_meta:any, cb: Function):any; + setTimeout(new_timeout: any): void; + setRequestID(request_id: any): void; + setUserName(user_name: string): void; + setLogger(logger: any): void; + setRequest(request_lib: any): void; + setMangler(mangle_lib: any): void; + getRequestOptions(path: string, json_value: any, extra_headers: any): RequestOption; + getToken(username: string, password: string, cb: (...args: any[]) => any): any; + getProjectTokenForReal(auth_data: any, cb: (...args: any[]) => any): any; + getProjectToken(access_token: any, project_id: any, cb: (...args: any[]) => any): any; + getProjectTokenByName(access_token: any, domain_id: any, project_name: string, cb: (...args: any[]) => any): any; + listProjects(admin_access_token: any, cb: (...args: any[]) => any): any; + listUserProjects(username: any, access_token: any, cb: (...args: any[]) => any): any; + getProjectByName(admin_access_token: any, project_name: any, cb: (...args: any[]) => any): any; + listRoles(project_token: any, cb: (...args: any[]) => any): any; + listRoleAssignments(project_token: any, project_id: any, cb: (...args: any[]) => any): any; + addRoleAssignment(project_token: any, project_id: any, entry_id: any, entry_type: any, role_id: any, cb: (...args: any[]) => any): any; + removeRoleAssignment(project_token: any, project_id: any, entry_id: any, entry_type: any, role_id: any, cb: (...args: any[]) => any): any; + listMetaEnvironments(auth_token: any, cb: (...args: any[]) => any): any; + listMetaOwningGroups(auth_token: any, cb: (...args: any[]) => any): any; + listProjectMeta(project_token: any, project_id: any, cb: (...args: any[]) => any): any; + updateProjectMeta(project_token: any, project_id: any, new_meta: any, cb: (...args: any[]) => any): any; } export class Neutron { request: any; - mangler:any; - mangleObject:any; - url:any; - token:any; - timeout:any; - request_id:any; - user_name:any; - logger:any; + mangler: any; + mangleObject: any; + url: any; + token: any; + timeout: any; + request_id: any; + user_name: any; + logger: any; constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setMangler(mangle_lib: any):void; - getRequestOptions(path: string, json_value: any, extra_headers: any):RequestOption; - listNetworks(cb: Function):any; - getNetwork(network_id:string, cb: Function):any; - listSubnets(cb: Function):any; - getSubnet(subnet_id:any, cb: Function):any; - listRouters(cb: Function):any; - getRouter(router_id:any, cb: Function):any; - createFloatingIp(floating_network_id:any, cb: Function):any; - listFloatingIps(options:any, cb: Function):any; - getFloatingIp(ip_id:any, cb: Function):any; - updateFloatingIp(ip_id:any, port_id:any,cb: Function):any; - removeFloatingIp(ip_id:any, cb: Function):any; - listPorts(options:any, cb: Function):any; - getPort(port_id:any,cb: Function):any; - updatePort(port_id:any, data:any, cb: Function):any; - listSecurityGroups(project_id:any, cb: Function):any; - getSecurityGroup(group_id:any, cb: Function):any; - createSecurityGroup(group_name:any, data:any, cb: Function):any; - updateSecurityGroup(group_id:any, data:any, cb: Function):any; - removeSecurityGroup(group_id:any, cb: Function):any; - listSecurityGroupRules(cb: Function):any; - getSecurityGroupRule(rule_id:any, cb: Function):any; - createSecurityGroupRule(group_id:any, data:any, cb: Function):any; - removeSecurityGroupRule(rule_id:any, cb: Function):any; - listLoadBalancers(cb: Function):any; - getLoadBalancer(lb_id:any, cb: Function):any; - createLoadBalancer(tenant_id:any, vip_subnet_id:any, cb: Function):any; - updateLoadBalancer(lb_id:any, data:any, cb: Function):any; - removeLoadBalancer(lb_id:any, cb: Function):any; - listLBListeners(cb: Function):any; - getLBListener(lb_id:any, cb: Function):any; - createLBListener(tenant_id:any, loadbalancer_id:any, description:any, protocol:any, data:any, cb: Function):any; - updateLBListener(listener_id:any, data:any, cb: Function):any; - removeLBListener(listener_id:any, cb: Function):any; - listLBPools(cb: Function):any; - getLBPool(pool_id:any, cb: Function):any; - createLBPool(tenant_id:any, protocol:any, lb_algorithm:any, listener_id:any, data:any, cb: Function):any; - updateLBPool(pool_id:any, data:any, cb: Function):any; - removeLBPool(pool_id:any, cb: Function):any; - listLBPoolMembers(pool_id:any, cb: Function):any; - getLBPoolMember(pool_id:any, member_id:any, cb: Function):any; - createLBPoolMember(pool_id:any, tenant_id:any, address:any, protocol_port:any, data:any, cb: Function):any; - updateLBPoolMember(pool_id:any, member_id:any, data:any, cb: Function):any; - removeLBPoolMember(pool_id:any, member_id:any, cb: Function):any; - listLBHealthMonitors(cb: Function):any; - getLBHealthMonitor(health_monitor_id:any, cb: Function):any; - createLBHealthMonitor(tenant_id:any, type:any, delay:any, timeout:any, max_retries:any, pool_id:any, data:any, cb: Function):any; - updateLBHealthMonitor(health_monitor_id:any, data:any, cb: Function):any; - removeLBHealthMonitor(health_monitor_id:any, cb: Function):any; - getLBStats(lb_id:any, cb: Function):any; + setTimeout(new_timeout: any): void; + setRequestID(request_id: any): void; + setUserName(user_name: string): void; + setLogger(logger: any): void; + setRequest(request_lib: any): void; + setMangler(mangle_lib: any): void; + getRequestOptions(path: string, json_value: any, extra_headers: any): RequestOption; + listNetworks(cb: (...args: any[]) => any): any; + getNetwork(network_id: string, cb: (...args: any[]) => any): any; + listSubnets(cb: (...args: any[]) => any): any; + getSubnet(subnet_id: any, cb: (...args: any[]) => any): any; + listRouters(cb: (...args: any[]) => any): any; + getRouter(router_id: any, cb: (...args: any[]) => any): any; + createFloatingIp(floating_network_id: any, cb: (...args: any[]) => any): any; + listFloatingIps(options: any, cb: (...args: any[]) => any): any; + getFloatingIp(ip_id: any, cb: (...args: any[]) => any): any; + updateFloatingIp(ip_id: any, port_id: any, cb: (...args: any[]) => any): any; + removeFloatingIp(ip_id: any, cb: (...args: any[]) => any): any; + listPorts(options: any, cb: (...args: any[]) => any): any; + getPort(port_id: any, cb: (...args: any[]) => any): any; + updatePort(port_id: any, data: any, cb: (...args: any[]) => any): any; + listSecurityGroups(project_id: any, cb: (...args: any[]) => any): any; + getSecurityGroup(group_id: any, cb: (...args: any[]) => any): any; + createSecurityGroup(group_name: any, data: any, cb: (...args: any[]) => any): any; + updateSecurityGroup(group_id: any, data: any, cb: (...args: any[]) => any): any; + removeSecurityGroup(group_id: any, cb: (...args: any[]) => any): any; + listSecurityGroupRules(cb: (...args: any[]) => any): any; + getSecurityGroupRule(rule_id: any, cb: (...args: any[]) => any): any; + createSecurityGroupRule(group_id: any, data: any, cb: (...args: any[]) => any): any; + removeSecurityGroupRule(rule_id: any, cb: (...args: any[]) => any): any; + listLoadBalancers(cb: (...args: any[]) => any): any; + getLoadBalancer(lb_id: any, cb: (...args: any[]) => any): any; + createLoadBalancer(tenant_id: any, vip_subnet_id: any, cb: (...args: any[]) => any): any; + updateLoadBalancer(lb_id: any, data: any, cb: (...args: any[]) => any): any; + removeLoadBalancer(lb_id: any, cb: (...args: any[]) => any): any; + listLBListeners(cb: (...args: any[]) => any): any; + getLBListener(lb_id: any, cb: (...args: any[]) => any): any; + createLBListener(tenant_id: any, loadbalancer_id: any, description: any, protocol: any, data: any, cb: (...args: any[]) => any): any; + updateLBListener(listener_id: any, data: any, cb: (...args: any[]) => any): any; + removeLBListener(listener_id: any, cb: (...args: any[]) => any): any; + listLBPools(cb: (...args: any[]) => any): any; + getLBPool(pool_id: any, cb: (...args: any[]) => any): any; + createLBPool(tenant_id: any, protocol: any, lb_algorithm: any, listener_id: any, data: any, cb: (...args: any[]) => any): any; + updateLBPool(pool_id: any, data: any, cb: (...args: any[]) => any): any; + removeLBPool(pool_id: any, cb: (...args: any[]) => any): any; + listLBPoolMembers(pool_id: any, cb: (...args: any[]) => any): any; + getLBPoolMember(pool_id: any, member_id: any, cb: (...args: any[]) => any): any; + createLBPoolMember(pool_id: any, tenant_id: any, address: any, protocol_port: any, data: any, cb: (...args: any[]) => any): any; + updateLBPoolMember(pool_id: any, member_id: any, data: any, cb: (...args: any[]) => any): any; + removeLBPoolMember(pool_id: any, member_id: any, cb: (...args: any[]) => any): any; + listLBHealthMonitors(cb: (...args: any[]) => any): any; + getLBHealthMonitor(health_monitor_id: any, cb: (...args: any[]) => any): any; + createLBHealthMonitor(tenant_id: any, type: any, delay: any, timeout: any, max_retries: any, pool_id: any, data: any, cb: (...args: any[]) => any): any; + updateLBHealthMonitor(health_monitor_id: any, data: any, cb: (...args: any[]) => any): any; + removeLBHealthMonitor(health_monitor_id: any, cb: (...args: any[]) => any): any; + getLBStats(lb_id: any, cb: (...args: any[]) => any): any; } export class Octavia { - url:any; - token:any; - timeout:any; - request_id:any; - user_name:string; - logger:any; + url: any; + token: any; + timeout: any; + request_id: any; + user_name: string; + logger: any; retries: number; retry_delay: number; constructor(endpoint_url: string, auth_token: string); - setTimeout(new_timeout: any):void; - setRequestID(request_id: any):void; - setUserName(user_name: string):void; - setLogger(logger: any):void; - setRequest(request_lib: any):void; - setRetries(retries:number):void; - setRetryDelay(retry_delay:number):void; - getRequestOptions(path: string, json_value:any):RequestOption; - listLoadBalancers(cb:Function):any; - getLoadBalancer(lb_id: string, cb:Function):any; - createLoadBalancer(project_id:string, data:any,cb:Function):any; - updateLoadBalancer(lb_id:string, data:any,cb:Function):any; - removeLoadBalancer(lb_id:string, cb:Function):any; - listLBListeners(cb:Function):any; - getLBListener(listener_id: string, cb:Function):any; - createLBListener(loadbalancer_id:string, protocol:any, data:any,cb:Function):any; - updateLBListener(listener_id:string, data:any,cb:Function):any; - removeLBListener(listener_id: string, cb:Function):any; - listLBPools(cb:Function):any; - getLBPool(pool_id: string, cb:Function):any; - createLBPool(protocol:any, lb_algorithm:any, data:any,cb:Function):any; - updateLBPool(pool_id:string, data:any,cb:Function):any; - removeLBPool(pool_id:string, cb:Function):any; - listLBPoolMembers(pool_id:string, cb:Function):any; - getLBPoolMember(pool_id:string, member_id:string,cb:Function):any; - createLBPoolMember(pool_id:string, address:any, protocol_port:any, data:any,cb:Function):any; - updateLBPoolMember(pool_id:string, member_id:string, data:any,cb:Function):any; - removeLBPoolMember(pool_id:string, member_id:string,cb:Function):any; - listLBHealthMonitors(cb:Function):any; - getLBHealthMonitor(health_monitor_id:string,cb:Function):any; - createLBHealthMonitor(pool_id:string, type:any, delay:number, timeout:number, max_retries:number, data:any,cb:Function):any; - updateLBHealthMonitor(health_monitor_id:string, data:any,cb:Function):any; - removeLBHealthMonitor(health_monitor_id:string,cb:Function):any; - getLBStats(lb_id:string,cb:Function):any; -} \ No newline at end of file + setTimeout(new_timeout: any): void; + setRequestID(request_id: any): void; + setUserName(user_name: string): void; + setLogger(logger: any): void; + setRequest(request_lib: any): void; + setRetries(retries: number): void; + setRetryDelay(retry_delay: number): void; + getRequestOptions(path: string, json_value: any): RequestOption; + listLoadBalancers(cb: (...args: any[]) => any): any; + getLoadBalancer(lb_id: string, cb: (...args: any[]) => any): any; + createLoadBalancer(project_id: string, data: any, cb: (...args: any[]) => any): any; + updateLoadBalancer(lb_id: string, data: any, cb: (...args: any[]) => any): any; + removeLoadBalancer(lb_id: string, cb: (...args: any[]) => any): any; + listLBListeners(cb: (...args: any[]) => any): any; + getLBListener(listener_id: string, cb: (...args: any[]) => any): any; + createLBListener(loadbalancer_id: string, protocol: any, data: any, cb: (...args: any[]) => any): any; + updateLBListener(listener_id: string, data: any, cb: (...args: any[]) => any): any; + removeLBListener(listener_id: string, cb: (...args: any[]) => any): any; + listLBPools(cb: (...args: any[]) => any): any; + getLBPool(pool_id: string, cb: (...args: any[]) => any): any; + createLBPool(protocol: any, lb_algorithm: any, data: any, cb: (...args: any[]) => any): any; + updateLBPool(pool_id: string, data: any, cb: (...args: any[]) => any): any; + removeLBPool(pool_id: string, cb: (...args: any[]) => any): any; + listLBPoolMembers(pool_id: string, cb: (...args: any[]) => any): any; + getLBPoolMember(pool_id: string, member_id: string, cb: (...args: any[]) => any): any; + createLBPoolMember(pool_id: string, address: any, protocol_port: any, data: any, cb: (...args: any[]) => any): any; + updateLBPoolMember(pool_id: string, member_id: string, data: any, cb: (...args: any[]) => any): any; + removeLBPoolMember(pool_id: string, member_id: string, cb: (...args: any[]) => any): any; + listLBHealthMonitors(cb: (...args: any[]) => any): any; + getLBHealthMonitor(health_monitor_id: string, cb: (...args: any[]) => any): any; + createLBHealthMonitor(pool_id: string, type: any, delay: number, timeout: number, max_retries: number, data: any, cb: (...args: any[]) => any): any; + updateLBHealthMonitor(health_monitor_id: string, data: any, cb: (...args: any[]) => any): any; + removeLBHealthMonitor(health_monitor_id: string, cb: (...args: any[]) => any): any; + getLBStats(lb_id: string, cb: (...args: any[]) => any): any; +} diff --git a/types/openstack-wrapper/openstack-wrapper-tests.ts b/types/openstack-wrapper/openstack-wrapper-tests.ts index a64dabcef8..448e203b88 100644 --- a/types/openstack-wrapper/openstack-wrapper-tests.ts +++ b/types/openstack-wrapper/openstack-wrapper-tests.ts @@ -1,7 +1,7 @@ import * as OSWrap from 'openstack-wrapper'; const keystone = new OSWrap.Keystone("endpoint-url"); -const glance = new OSWrap.Glance("endpoint-url","auth-token"); -const neutron = new OSWrap.Neutron("endpoint-url","auth-token"); -const octavia = new OSWrap.Octavia("endpoint-url","auth-token"); -const nova = new OSWrap.Nova("endpoint-url","auth-token"); \ No newline at end of file +const glance = new OSWrap.Glance("endpoint-url", "auth-token"); +const neutron = new OSWrap.Neutron("endpoint-url", "auth-token"); +const octavia = new OSWrap.Octavia("endpoint-url", "auth-token"); +const nova = new OSWrap.Nova("endpoint-url", "auth-token"); diff --git a/types/openstack-wrapper/tslint.json b/types/openstack-wrapper/tslint.json new file mode 100644 index 0000000000..b09ce9d85d --- /dev/null +++ b/types/openstack-wrapper/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json", + "rules": { } +} \ No newline at end of file From e3cd24ccb2bb91548337c8d59be3dc483a9e3756 Mon Sep 17 00:00:00 2001 From: sanjaymadane Date: Thu, 17 Aug 2017 09:34:23 +0800 Subject: [PATCH 6/6] strictNullChecks turn on --- types/openstack-wrapper/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/openstack-wrapper/tsconfig.json b/types/openstack-wrapper/tsconfig.json index 0ccc091222..07feed0989 100644 --- a/types/openstack-wrapper/tsconfig.json +++ b/types/openstack-wrapper/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../"