node-ovh-ts
Version:
OVH API wrapper library for TypeScript
1 lines • 15.5 kB
Source Map (JSON)
{"version":3,"sources":["../src/handlers/OvhCloudConnect.ts"],"sourcesContent":["/* WARNING: This file is auto-generated . Do not edit manually. */\n\nimport { OvhcloudconnectKey } from '../models/OvhcloudconnectKey';\nimport { OvhcloudconnectService } from '../models/OvhcloudconnectService';\nimport { OvhcloudconnectInterfaceMetricsPeriodEnum } from '../models/OvhcloudconnectInterfaceMetricsPeriodEnum';\nimport { OvhcloudconnectTo } from '../models/OvhcloudconnectTo';\nimport { ServicesService } from '../models/ServicesService';\nimport { ServiceTerminationFutureUseEnum } from '../models/ServiceTerminationFutureUseEnum';\nimport { OvhcloudconnectMetrics } from '../models/OvhcloudconnectMetrics';\nimport { OvhcloudconnectInterface } from '../models/OvhcloudconnectInterface';\nimport { OvhcloudconnectDatacenter } from '../models/OvhcloudconnectDatacenter';\nimport { OvhcloudconnectTask } from '../models/OvhcloudconnectTask';\nimport { OvhcloudconnectDiagnostic } from '../models/OvhcloudconnectDiagnostic';\nimport { OvhcloudconnectPopConfig } from '../models/OvhcloudconnectPopConfig';\nimport { OvhcloudconnectDiagnosticConfiguration } from '../models/OvhcloudconnectDiagnosticConfiguration';\nimport { OvhcloudconnectDatacenterExtraConfig } from '../models/OvhcloudconnectDatacenterExtraConfig';\nimport { OvhcloudconnectInterfaceMetricsTypeEnum } from '../models/OvhcloudconnectInterfaceMetricsTypeEnum';\nimport { OvhcloudconnectDatacenterConfig } from '../models/OvhcloudconnectDatacenterConfig';\nimport { ServiceTerminationReasonEnum } from '../models/ServiceTerminationReasonEnum';\nimport { OvhcloudconnectSendKeyAnswer } from '../models/OvhcloudconnectSendKeyAnswer';\nimport { OvhcloudconnectUpdate } from '../models/OvhcloudconnectUpdate';\nimport OVHBase from '../ovh';\n\nclass OvhCloudConnectHandler {\n ovh: OVHBase;\n\n constructor(ovh: OVHBase) {\n this.ovh = ovh;\n }\n\n /** List available services */\n list = (): Promise<string[]> => {\n return this.ovh.request('GET', '/ovhCloudConnect');\n };\n\n /** Get service */\n getByServiceName = (serviceName: string): Promise<OvhcloudconnectService> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}`);\n };\n\n /** Modify service */\n putByServiceName = (serviceName: string, body: OvhcloudconnectUpdate): Promise<void> => {\n return this.ovh.request('PUT', `/ovhCloudConnect/${serviceName}`, body);\n };\n\n /** Launch a contact change procedure */\n launchChangeContactByServiceName = (\n serviceName: string,\n body: { contactAdmin?: string; contactBilling?: string; contactTech?: string }\n ): Promise<number[]> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/changeContact`, body);\n };\n\n /** Get Pop Configuration linked to of a OVHcloud Connect Service */\n getConfigPopByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/config/pop`);\n };\n\n /** Create a Pop Configuration */\n createConfigPopByServiceName = (\n serviceName: string,\n body: OvhcloudconnectPopConfig\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/config/pop`, body);\n };\n\n /** Delete a Pop Configuration */\n deleteConfigPopByServiceNameAndPopId = (\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request('DELETE', `/ovhCloudConnect/${serviceName}/config/pop/${popId}`);\n };\n\n /** Get Pop Configuration of a OVHcloud Connect Service */\n getConfigPopByServiceNameAndPopId = (\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectPopConfig> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/config/pop/${popId}`);\n };\n\n /** Get Datacenter Configuration linked to of a OVHcloud Connect Service */\n getConfigPopDatacenterByServiceNameAndPopId = (\n popId: number,\n serviceName: string\n ): Promise<number[]> => {\n return this.ovh.request(\n 'GET',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter`\n );\n };\n\n /** Create a Datacenter Configuration */\n createConfigPopDatacenterByServiceNameAndPopId = (\n popId: number,\n serviceName: string,\n body: OvhcloudconnectDatacenterConfig\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request(\n 'POST',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter`,\n body\n );\n };\n\n /** Delete a Datacenter Configuration */\n deleteConfigPopDatacenterByServiceNameAndPopIdAndDatacenterId = (\n datacenterId: number,\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request(\n 'DELETE',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}`\n );\n };\n\n /** Get Datacenter Configuration of a OVHcloud Connect Service */\n getConfigPopDatacenterByServiceNameAndPopIdAndDatacenterId = (\n datacenterId: number,\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectDatacenterConfig> => {\n return this.ovh.request(\n 'GET',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}`\n );\n };\n\n /** Get Datacenter Extra Configuration linked to of a OVHcloud Connect Service */\n getConfigPopDatacenterExtraByServiceNameAndPopIdAndDatacenterId = (\n datacenterId: number,\n popId: number,\n serviceName: string\n ): Promise<number[]> => {\n return this.ovh.request(\n 'GET',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}/extra`\n );\n };\n\n /** Create a Datacenter Extra Configuration */\n createConfigPopDatacenterExtraByServiceNameAndPopIdAndDatacenterId = (\n datacenterId: number,\n popId: number,\n serviceName: string,\n body: OvhcloudconnectDatacenterExtraConfig\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request(\n 'POST',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}/extra`,\n body\n );\n };\n\n /** Delete a Datacenter Extra Configuration */\n deleteConfigPopDatacenterExtraByServiceNameAndPopIdAndDatacenterIdAndExtraId = (\n datacenterId: number,\n extraId: number,\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request(\n 'DELETE',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}/extra/${extraId}`\n );\n };\n\n /** Get Datacenter Extra Configuration of a OVHcloud Connect Service */\n getConfigPopDatacenterExtraByServiceNameAndPopIdAndDatacenterIdAndExtraId = (\n datacenterId: number,\n extraId: number,\n popId: number,\n serviceName: string\n ): Promise<OvhcloudconnectDatacenterExtraConfig> => {\n return this.ovh.request(\n 'GET',\n `/ovhCloudConnect/${serviceName}/config/pop/${popId}/datacenter/${datacenterId}/extra/${extraId}`\n );\n };\n\n /** Confirm termination of your service */\n confirmTerminationByServiceName = (\n serviceName: string,\n body: {\n commentary?: string;\n futureUse?: ServiceTerminationFutureUseEnum;\n reason?: ServiceTerminationReasonEnum;\n token: string;\n }\n ): Promise<string> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/confirmTermination`, body);\n };\n\n /** List available Datacenter */\n listDatacenterByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/datacenter`);\n };\n\n /** Get Datacenter */\n getDatacenterByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectDatacenter> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/datacenter/${id}`);\n };\n\n /** Get Diagnostics linked to a OVHcloud Connect Service */\n getDiagnosticByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/diagnostic`);\n };\n\n /** Create a Diagnostic linked to a OVHcloud Connect Service */\n createDiagnosticByServiceName = (\n serviceName: string,\n body: OvhcloudconnectDiagnosticConfiguration\n ): Promise<OvhcloudconnectDiagnostic> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/diagnostic`, body);\n };\n\n /** Get Diagnostic linked to a OVHcloud Connect Service */\n getDiagnosticByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectDiagnostic> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/diagnostic/${id}`);\n };\n\n /** List interfaces linked to the Service */\n listInterfaceByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/interface`);\n };\n\n /** Get the Interface information */\n getInterfaceByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectInterface> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/interface/${id}`);\n };\n\n /** Lock the port */\n postInterfaceLockByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/interface/${id}/lock`);\n };\n\n /** Statistics for an OCC interface for a given type */\n getInterfaceStatisticsByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectMetrics[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/interface/${id}/statistics`);\n };\n\n /** Unlock the port */\n postInterfaceUnlockByServiceNameAndId = (\n id: number,\n serviceName: string\n ): Promise<OvhcloudconnectTask> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/interface/${id}/unlock`);\n };\n\n /** Generate a loa for a service */\n postLoaByServiceName = (serviceName: string): Promise<string> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/loa`);\n };\n\n /** Get this object properties */\n getServiceInfosByServiceName = (serviceName: string): Promise<ServicesService> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/serviceInfos`);\n };\n\n /** Alter this object properties */\n updateServiceInfosByServiceName = (serviceName: string, body: ServicesService): Promise<void> => {\n return this.ovh.request('PUT', `/ovhCloudConnect/${serviceName}/serviceInfos`, body);\n };\n\n /** Get Keys linked to a OVHcloud Connect Service */\n getServiceKeyByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/serviceKey`);\n };\n\n /** Get Key linked to a OVHcloud Connect Service */\n getServiceKeyByServiceNameAndServiceKeyId = (\n serviceKeyId: number,\n serviceName: string\n ): Promise<OvhcloudconnectKey> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/serviceKey/${serviceKeyId}`);\n };\n\n /** Regenerate Service Key linked to a OVHcloud Connect Service */\n postServiceKeyRegenerateByServiceNameAndServiceKeyId = (\n serviceKeyId: number,\n serviceName: string\n ): Promise<OvhcloudconnectKey> => {\n return this.ovh.request(\n 'POST',\n `/ovhCloudConnect/${serviceName}/serviceKey/${serviceKeyId}/regenerate`\n );\n };\n\n /** Send key value to customer */\n sendServiceKeyByServiceNameAndServiceKeyId = (\n serviceKeyId: number,\n serviceName: string,\n body: OvhcloudconnectTo\n ): Promise<OvhcloudconnectSendKeyAnswer> => {\n return this.ovh.request(\n 'POST',\n `/ovhCloudConnect/${serviceName}/serviceKey/${serviceKeyId}/send`,\n body\n );\n };\n\n /** Get Task linked to a OVHcloud Connect Service */\n getTaskByServiceName = (serviceName: string): Promise<number[]> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/task`);\n };\n\n /** Get Tasks linked to a OVHcloud Connect Service */\n getTaskByServiceNameAndId = (id: number, serviceName: string): Promise<OvhcloudconnectTask> => {\n return this.ovh.request('GET', `/ovhCloudConnect/${serviceName}/task/${id}`);\n };\n\n /** Terminate your service */\n postTerminateByServiceName = (serviceName: string): Promise<string> => {\n return this.ovh.request('POST', `/ovhCloudConnect/${serviceName}/terminate`);\n };\n}\n\nexport { OvhCloudConnectHandler };\n"],"mappings":"AAuBA,IAAMA,EAAN,KAA6B,CAG3B,YAAYC,EAAc,CAK1B,UAAO,IACE,KAAK,IAAI,QAAQ,MAAO,kBAAkB,EAInD,sBAAoBC,GACX,KAAK,IAAI,QAAQ,MAAO,oBAAoBA,GAAa,EAIlE,sBAAmB,CAACA,EAAqBC,IAChC,KAAK,IAAI,QAAQ,MAAO,oBAAoBD,IAAeC,CAAI,EAIxE,sCAAmC,CACjCD,EACAC,IAEO,KAAK,IAAI,QAAQ,OAAQ,oBAAo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