@alicloud/dataworks-public20240518 7.2.2 → 7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +5 -0
- package/dist/client.js +264 -197
- package/dist/client.js.map +1 -1
- package/dist/models/CreateDijobRequest.d.ts +54 -0
- package/dist/models/CreateDijobRequest.js.map +1 -1
- package/dist/models/CreateDijobShrinkRequest.d.ts +54 -0
- package/dist/models/CreateDijobShrinkRequest.js.map +1 -1
- package/dist/models/GetWorkflowInstanceResponseBodyWorkflowInstance.d.ts +1 -0
- package/dist/models/GetWorkflowInstanceResponseBodyWorkflowInstance.js +2 -0
- package/dist/models/GetWorkflowInstanceResponseBodyWorkflowInstance.js.map +1 -1
- package/dist/models/ListWorkflowInstancesResponseBodyPagingInfoWorkflowInstances.d.ts +1 -0
- package/dist/models/ListWorkflowInstancesResponseBodyPagingInfoWorkflowInstances.js +2 -0
- package/dist/models/ListWorkflowInstancesResponseBodyPagingInfoWorkflowInstances.js.map +1 -1
- package/dist/models/UpdateDijobRequest.d.ts +15 -0
- package/dist/models/UpdateDijobRequest.js.map +1 -1
- package/dist/models/UpdateDijobShrinkRequest.d.ts +15 -0
- package/dist/models/UpdateDijobShrinkRequest.js.map +1 -1
- package/package.json +2 -5
- package/src/client.ts +277 -199
- package/src/models/CreateDijobRequest.ts +54 -0
- package/src/models/CreateDijobShrinkRequest.ts +54 -0
- package/src/models/GetWorkflowInstanceResponseBodyWorkflowInstance.ts +3 -0
- package/src/models/ListWorkflowInstancesResponseBodyPagingInfoWorkflowInstances.ts +3 -0
- package/src/models/UpdateDijobRequest.ts +15 -0
- package/src/models/UpdateDijobShrinkRequest.ts +15 -0
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import * as $_model from './models/model';
|
|
|
5
5
|
export * from './models/model';
|
|
6
6
|
export default class Client extends OpenApi {
|
|
7
7
|
constructor(config: $OpenApiUtil.Config);
|
|
8
|
+
_postOSSObject(bucketName: string, form: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>;
|
|
8
13
|
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
9
14
|
[key: string]: string;
|
|
10
15
|
}, endpoint: string): string;
|
package/dist/client.js
CHANGED
|
@@ -35,17 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
39
|
// This file is auto-generated, don't edit it
|
|
43
40
|
const $dara = __importStar(require("@darabonba/typescript"));
|
|
44
|
-
const
|
|
45
|
-
const openplatform20191219_1 = __importStar(require("@alicloud/openplatform20191219")), $OpenPlatform = openplatform20191219_1;
|
|
46
|
-
const $OSSUtil = __importStar(require("@alicloud/oss-util"));
|
|
47
|
-
const $FileForm = __importStar(require("@alicloud/tea-fileform"));
|
|
48
|
-
const openapi_core_1 = __importDefault(require("@alicloud/openapi-core"));
|
|
41
|
+
const openapi_core_1 = __importStar(require("@alicloud/openapi-core")), $OpenApi = openapi_core_1;
|
|
49
42
|
const openapi_core_2 = require("@alicloud/openapi-core");
|
|
50
43
|
const $_model = __importStar(require("./models/model"));
|
|
51
44
|
__exportStar(require("./models/model"), exports);
|
|
@@ -82,6 +75,38 @@ class Client extends openapi_core_1.default {
|
|
|
82
75
|
this.checkConfig(config);
|
|
83
76
|
this._endpoint = this.getEndpoint("dataworks-public", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint);
|
|
84
77
|
}
|
|
78
|
+
async _postOSSObject(bucketName, form) {
|
|
79
|
+
let request_ = new $dara.Request();
|
|
80
|
+
let boundary = $dara.Form.getBoundary();
|
|
81
|
+
request_.protocol = "HTTPS";
|
|
82
|
+
request_.method = "POST";
|
|
83
|
+
request_.pathname = `/`;
|
|
84
|
+
request_.headers = {
|
|
85
|
+
host: String(form["host"]),
|
|
86
|
+
date: openapi_core_2.OpenApiUtil.getDateUTCString(),
|
|
87
|
+
'user-agent': openapi_core_2.OpenApiUtil.getUserAgent(""),
|
|
88
|
+
};
|
|
89
|
+
request_.headers["content-type"] = `multipart/form-data; boundary=${boundary}`;
|
|
90
|
+
request_.body = $dara.Form.toFileForm(form, boundary);
|
|
91
|
+
let response_ = await $dara.doAction(request_);
|
|
92
|
+
let respMap = null;
|
|
93
|
+
let bodyStr = await $dara.Stream.readAsString(response_.body);
|
|
94
|
+
if ((response_.statusCode >= 400) && (response_.statusCode < 600)) {
|
|
95
|
+
respMap = $dara.XML.parseXml(bodyStr, null);
|
|
96
|
+
let err = respMap["Error"];
|
|
97
|
+
throw new $OpenApi.ClientError({
|
|
98
|
+
code: String(err["Code"]),
|
|
99
|
+
message: String(err["Message"]),
|
|
100
|
+
data: {
|
|
101
|
+
httpCode: response_.statusCode,
|
|
102
|
+
requestId: String(err["RequestId"]),
|
|
103
|
+
hostId: String(err["HostId"]),
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
respMap = $dara.XML.parseXml(bodyStr, null);
|
|
108
|
+
return Object.assign({}, respMap);
|
|
109
|
+
}
|
|
85
110
|
getEndpoint(productId, regionId, endpointRule, network, suffix, endpointMap, endpoint) {
|
|
86
111
|
if (!$dara.isNull(endpoint)) {
|
|
87
112
|
return endpoint;
|
|
@@ -571,33 +596,37 @@ class Client extends openapi_core_1.default {
|
|
|
571
596
|
if (!$dara.isNull(tmpReq.transformationRules)) {
|
|
572
597
|
request.transformationRulesShrink = openapi_core_2.OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.transformationRules, "TransformationRules", "json");
|
|
573
598
|
}
|
|
574
|
-
let
|
|
575
|
-
if (!$dara.isNull(request.description)) {
|
|
576
|
-
body["Description"] = request.description;
|
|
577
|
-
}
|
|
578
|
-
if (!$dara.isNull(request.destinationDataSourceSettingsShrink)) {
|
|
579
|
-
body["DestinationDataSourceSettings"] = request.destinationDataSourceSettingsShrink;
|
|
580
|
-
}
|
|
599
|
+
let query = {};
|
|
581
600
|
if (!$dara.isNull(request.destinationDataSourceType)) {
|
|
582
|
-
|
|
601
|
+
query["DestinationDataSourceType"] = request.destinationDataSourceType;
|
|
583
602
|
}
|
|
584
603
|
if (!$dara.isNull(request.jobName)) {
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
if (!$dara.isNull(request.jobSettingsShrink)) {
|
|
588
|
-
body["JobSettings"] = request.jobSettingsShrink;
|
|
604
|
+
query["JobName"] = request.jobName;
|
|
589
605
|
}
|
|
590
606
|
if (!$dara.isNull(request.jobType)) {
|
|
591
|
-
|
|
607
|
+
query["JobType"] = request.jobType;
|
|
592
608
|
}
|
|
593
609
|
if (!$dara.isNull(request.migrationType)) {
|
|
594
|
-
|
|
610
|
+
query["MigrationType"] = request.migrationType;
|
|
595
611
|
}
|
|
596
612
|
if (!$dara.isNull(request.name)) {
|
|
597
|
-
|
|
613
|
+
query["Name"] = request.name;
|
|
598
614
|
}
|
|
599
615
|
if (!$dara.isNull(request.projectId)) {
|
|
600
|
-
|
|
616
|
+
query["ProjectId"] = request.projectId;
|
|
617
|
+
}
|
|
618
|
+
if (!$dara.isNull(request.sourceDataSourceType)) {
|
|
619
|
+
query["SourceDataSourceType"] = request.sourceDataSourceType;
|
|
620
|
+
}
|
|
621
|
+
let body = {};
|
|
622
|
+
if (!$dara.isNull(request.description)) {
|
|
623
|
+
body["Description"] = request.description;
|
|
624
|
+
}
|
|
625
|
+
if (!$dara.isNull(request.destinationDataSourceSettingsShrink)) {
|
|
626
|
+
body["DestinationDataSourceSettings"] = request.destinationDataSourceSettingsShrink;
|
|
627
|
+
}
|
|
628
|
+
if (!$dara.isNull(request.jobSettingsShrink)) {
|
|
629
|
+
body["JobSettings"] = request.jobSettingsShrink;
|
|
601
630
|
}
|
|
602
631
|
if (!$dara.isNull(request.resourceSettingsShrink)) {
|
|
603
632
|
body["ResourceSettings"] = request.resourceSettingsShrink;
|
|
@@ -605,9 +634,6 @@ class Client extends openapi_core_1.default {
|
|
|
605
634
|
if (!$dara.isNull(request.sourceDataSourceSettingsShrink)) {
|
|
606
635
|
body["SourceDataSourceSettings"] = request.sourceDataSourceSettingsShrink;
|
|
607
636
|
}
|
|
608
|
-
if (!$dara.isNull(request.sourceDataSourceType)) {
|
|
609
|
-
body["SourceDataSourceType"] = request.sourceDataSourceType;
|
|
610
|
-
}
|
|
611
637
|
if (!$dara.isNull(request.tableMappingsShrink)) {
|
|
612
638
|
body["TableMappings"] = request.tableMappingsShrink;
|
|
613
639
|
}
|
|
@@ -615,6 +641,7 @@ class Client extends openapi_core_1.default {
|
|
|
615
641
|
body["TransformationRules"] = request.transformationRulesShrink;
|
|
616
642
|
}
|
|
617
643
|
let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
644
|
+
query: openapi_core_2.OpenApiUtil.query(query),
|
|
618
645
|
body: openapi_core_2.OpenApiUtil.parseToMap(body),
|
|
619
646
|
});
|
|
620
647
|
let params = new openapi_core_2.$OpenApiUtil.Params({
|
|
@@ -1783,12 +1810,19 @@ class Client extends openapi_core_1.default {
|
|
|
1783
1810
|
}
|
|
1784
1811
|
async createResourceAdvance(request, runtime) {
|
|
1785
1812
|
// Step 0: init client
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1813
|
+
if ($dara.isNull(this._credential)) {
|
|
1814
|
+
throw new $OpenApi.ClientError({
|
|
1815
|
+
code: "InvalidCredentials",
|
|
1816
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
let credentialModel = await this._credential.getCredential();
|
|
1820
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
1821
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
1822
|
+
let securityToken = credentialModel.securityToken;
|
|
1823
|
+
let credentialType = credentialModel.type;
|
|
1790
1824
|
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
1791
|
-
if ($dara.isNull(openPlatformEndpoint)) {
|
|
1825
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
1792
1826
|
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
1793
1827
|
}
|
|
1794
1828
|
if ($dara.isNull(credentialType)) {
|
|
@@ -1803,51 +1837,54 @@ class Client extends openapi_core_1.default {
|
|
|
1803
1837
|
protocol: this._protocol,
|
|
1804
1838
|
regionId: this._regionId,
|
|
1805
1839
|
});
|
|
1806
|
-
let authClient = new
|
|
1807
|
-
let authRequest =
|
|
1808
|
-
|
|
1809
|
-
|
|
1840
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
1841
|
+
let authRequest = {
|
|
1842
|
+
Product: "dataworks-public",
|
|
1843
|
+
RegionId: this._regionId,
|
|
1844
|
+
};
|
|
1845
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
1846
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
1810
1847
|
});
|
|
1811
|
-
let
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1848
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
1849
|
+
action: "AuthorizeFileUpload",
|
|
1850
|
+
version: "2019-12-19",
|
|
1851
|
+
protocol: "HTTPS",
|
|
1852
|
+
pathname: "/",
|
|
1853
|
+
method: "GET",
|
|
1854
|
+
authType: "AK",
|
|
1855
|
+
style: "RPC",
|
|
1856
|
+
reqBodyType: "formData",
|
|
1857
|
+
bodyType: "json",
|
|
1818
1858
|
});
|
|
1819
|
-
let
|
|
1820
|
-
let fileObj = new $
|
|
1821
|
-
let ossHeader =
|
|
1822
|
-
let
|
|
1823
|
-
let
|
|
1824
|
-
|
|
1859
|
+
let authResponse = {};
|
|
1860
|
+
let fileObj = new $dara.FileField({});
|
|
1861
|
+
let ossHeader = {};
|
|
1862
|
+
let tmpBody = {};
|
|
1863
|
+
let useAccelerate = false;
|
|
1864
|
+
let authResponseBody = {};
|
|
1825
1865
|
let createResourceReq = new $_model.CreateResourceRequest({});
|
|
1826
1866
|
openapi_core_2.OpenApiUtil.convert(request, createResourceReq);
|
|
1827
1867
|
if (!$dara.isNull(request.resourceFileObject)) {
|
|
1828
|
-
authResponse = await authClient.
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
fileObj = new $
|
|
1833
|
-
filename:
|
|
1868
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
1869
|
+
tmpBody = authResponse["body"];
|
|
1870
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
1871
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
1872
|
+
fileObj = new $dara.FileField({
|
|
1873
|
+
filename: authResponseBody["ObjectKey"],
|
|
1834
1874
|
content: request.resourceFileObject,
|
|
1835
1875
|
contentType: "",
|
|
1836
1876
|
});
|
|
1837
|
-
ossHeader =
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1877
|
+
ossHeader = {
|
|
1878
|
+
host: `${authResponseBody["Bucket"]}.${openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
|
|
1879
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
1880
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
1881
|
+
Signature: authResponseBody["Signature"],
|
|
1882
|
+
key: authResponseBody["ObjectKey"],
|
|
1842
1883
|
file: fileObj,
|
|
1843
|
-
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
header: ossHeader,
|
|
1848
|
-
});
|
|
1849
|
-
await ossClient.postObject(uploadRequest, ossRuntime);
|
|
1850
|
-
createResourceReq.resourceFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
|
|
1884
|
+
success_action_status: "201",
|
|
1885
|
+
};
|
|
1886
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
|
|
1887
|
+
createResourceReq.resourceFile = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
1851
1888
|
}
|
|
1852
1889
|
let createResourceResp = await this.createResourceWithOptions(createResourceReq, runtime);
|
|
1853
1890
|
return createResourceResp;
|
|
@@ -1926,12 +1963,19 @@ class Client extends openapi_core_1.default {
|
|
|
1926
1963
|
}
|
|
1927
1964
|
async createResourceFileAdvance(request, runtime) {
|
|
1928
1965
|
// Step 0: init client
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1966
|
+
if ($dara.isNull(this._credential)) {
|
|
1967
|
+
throw new $OpenApi.ClientError({
|
|
1968
|
+
code: "InvalidCredentials",
|
|
1969
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
let credentialModel = await this._credential.getCredential();
|
|
1973
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
1974
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
1975
|
+
let securityToken = credentialModel.securityToken;
|
|
1976
|
+
let credentialType = credentialModel.type;
|
|
1933
1977
|
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
1934
|
-
if ($dara.isNull(openPlatformEndpoint)) {
|
|
1978
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
1935
1979
|
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
1936
1980
|
}
|
|
1937
1981
|
if ($dara.isNull(credentialType)) {
|
|
@@ -1946,51 +1990,54 @@ class Client extends openapi_core_1.default {
|
|
|
1946
1990
|
protocol: this._protocol,
|
|
1947
1991
|
regionId: this._regionId,
|
|
1948
1992
|
});
|
|
1949
|
-
let authClient = new
|
|
1950
|
-
let authRequest =
|
|
1951
|
-
|
|
1952
|
-
|
|
1993
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
1994
|
+
let authRequest = {
|
|
1995
|
+
Product: "dataworks-public",
|
|
1996
|
+
RegionId: this._regionId,
|
|
1997
|
+
};
|
|
1998
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
1999
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
1953
2000
|
});
|
|
1954
|
-
let
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2001
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
2002
|
+
action: "AuthorizeFileUpload",
|
|
2003
|
+
version: "2019-12-19",
|
|
2004
|
+
protocol: "HTTPS",
|
|
2005
|
+
pathname: "/",
|
|
2006
|
+
method: "GET",
|
|
2007
|
+
authType: "AK",
|
|
2008
|
+
style: "RPC",
|
|
2009
|
+
reqBodyType: "formData",
|
|
2010
|
+
bodyType: "json",
|
|
1961
2011
|
});
|
|
1962
|
-
let
|
|
1963
|
-
let fileObj = new $
|
|
1964
|
-
let ossHeader =
|
|
1965
|
-
let
|
|
1966
|
-
let
|
|
1967
|
-
|
|
2012
|
+
let authResponse = {};
|
|
2013
|
+
let fileObj = new $dara.FileField({});
|
|
2014
|
+
let ossHeader = {};
|
|
2015
|
+
let tmpBody = {};
|
|
2016
|
+
let useAccelerate = false;
|
|
2017
|
+
let authResponseBody = {};
|
|
1968
2018
|
let createResourceFileReq = new $_model.CreateResourceFileRequest({});
|
|
1969
2019
|
openapi_core_2.OpenApiUtil.convert(request, createResourceFileReq);
|
|
1970
2020
|
if (!$dara.isNull(request.resourceFileObject)) {
|
|
1971
|
-
authResponse = await authClient.
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
fileObj = new $
|
|
1976
|
-
filename:
|
|
2021
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
2022
|
+
tmpBody = authResponse["body"];
|
|
2023
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
2024
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
2025
|
+
fileObj = new $dara.FileField({
|
|
2026
|
+
filename: authResponseBody["ObjectKey"],
|
|
1977
2027
|
content: request.resourceFileObject,
|
|
1978
2028
|
contentType: "",
|
|
1979
2029
|
});
|
|
1980
|
-
ossHeader =
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
2030
|
+
ossHeader = {
|
|
2031
|
+
host: `${authResponseBody["Bucket"]}.${openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
|
|
2032
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
2033
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
2034
|
+
Signature: authResponseBody["Signature"],
|
|
2035
|
+
key: authResponseBody["ObjectKey"],
|
|
1985
2036
|
file: fileObj,
|
|
1986
|
-
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
header: ossHeader,
|
|
1991
|
-
});
|
|
1992
|
-
await ossClient.postObject(uploadRequest, ossRuntime);
|
|
1993
|
-
createResourceFileReq.resourceFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
|
|
2037
|
+
success_action_status: "201",
|
|
2038
|
+
};
|
|
2039
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
|
|
2040
|
+
createResourceFileReq.resourceFile = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
1994
2041
|
}
|
|
1995
2042
|
let createResourceFileResp = await this.createResourceFileWithOptions(createResourceFileReq, runtime);
|
|
1996
2043
|
return createResourceFileResp;
|
|
@@ -5605,12 +5652,19 @@ class Client extends openapi_core_1.default {
|
|
|
5605
5652
|
}
|
|
5606
5653
|
async importCertificateAdvance(request, runtime) {
|
|
5607
5654
|
// Step 0: init client
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5655
|
+
if ($dara.isNull(this._credential)) {
|
|
5656
|
+
throw new $OpenApi.ClientError({
|
|
5657
|
+
code: "InvalidCredentials",
|
|
5658
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
5659
|
+
});
|
|
5660
|
+
}
|
|
5661
|
+
let credentialModel = await this._credential.getCredential();
|
|
5662
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
5663
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
5664
|
+
let securityToken = credentialModel.securityToken;
|
|
5665
|
+
let credentialType = credentialModel.type;
|
|
5612
5666
|
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
5613
|
-
if ($dara.isNull(openPlatformEndpoint)) {
|
|
5667
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
5614
5668
|
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
5615
5669
|
}
|
|
5616
5670
|
if ($dara.isNull(credentialType)) {
|
|
@@ -5625,51 +5679,54 @@ class Client extends openapi_core_1.default {
|
|
|
5625
5679
|
protocol: this._protocol,
|
|
5626
5680
|
regionId: this._regionId,
|
|
5627
5681
|
});
|
|
5628
|
-
let authClient = new
|
|
5629
|
-
let authRequest =
|
|
5630
|
-
|
|
5631
|
-
|
|
5682
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
5683
|
+
let authRequest = {
|
|
5684
|
+
Product: "dataworks-public",
|
|
5685
|
+
RegionId: this._regionId,
|
|
5686
|
+
};
|
|
5687
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
5688
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
5632
5689
|
});
|
|
5633
|
-
let
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5690
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
5691
|
+
action: "AuthorizeFileUpload",
|
|
5692
|
+
version: "2019-12-19",
|
|
5693
|
+
protocol: "HTTPS",
|
|
5694
|
+
pathname: "/",
|
|
5695
|
+
method: "GET",
|
|
5696
|
+
authType: "AK",
|
|
5697
|
+
style: "RPC",
|
|
5698
|
+
reqBodyType: "formData",
|
|
5699
|
+
bodyType: "json",
|
|
5640
5700
|
});
|
|
5641
|
-
let
|
|
5642
|
-
let fileObj = new $
|
|
5643
|
-
let ossHeader =
|
|
5644
|
-
let
|
|
5645
|
-
let
|
|
5646
|
-
|
|
5701
|
+
let authResponse = {};
|
|
5702
|
+
let fileObj = new $dara.FileField({});
|
|
5703
|
+
let ossHeader = {};
|
|
5704
|
+
let tmpBody = {};
|
|
5705
|
+
let useAccelerate = false;
|
|
5706
|
+
let authResponseBody = {};
|
|
5647
5707
|
let importCertificateReq = new $_model.ImportCertificateRequest({});
|
|
5648
5708
|
openapi_core_2.OpenApiUtil.convert(request, importCertificateReq);
|
|
5649
5709
|
if (!$dara.isNull(request.certificateFileObject)) {
|
|
5650
|
-
authResponse = await authClient.
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
fileObj = new $
|
|
5655
|
-
filename:
|
|
5710
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
5711
|
+
tmpBody = authResponse["body"];
|
|
5712
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
5713
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
5714
|
+
fileObj = new $dara.FileField({
|
|
5715
|
+
filename: authResponseBody["ObjectKey"],
|
|
5656
5716
|
content: request.certificateFileObject,
|
|
5657
5717
|
contentType: "",
|
|
5658
5718
|
});
|
|
5659
|
-
ossHeader =
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5719
|
+
ossHeader = {
|
|
5720
|
+
host: `${authResponseBody["Bucket"]}.${openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
|
|
5721
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
5722
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
5723
|
+
Signature: authResponseBody["Signature"],
|
|
5724
|
+
key: authResponseBody["ObjectKey"],
|
|
5664
5725
|
file: fileObj,
|
|
5665
|
-
|
|
5666
|
-
}
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
header: ossHeader,
|
|
5670
|
-
});
|
|
5671
|
-
await ossClient.postObject(uploadRequest, ossRuntime);
|
|
5672
|
-
importCertificateReq.certificateFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
|
|
5726
|
+
success_action_status: "201",
|
|
5727
|
+
};
|
|
5728
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
|
|
5729
|
+
importCertificateReq.certificateFile = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
5673
5730
|
}
|
|
5674
5731
|
let importCertificateResp = await this.importCertificateWithOptions(importCertificateReq, runtime);
|
|
5675
5732
|
return importCertificateResp;
|
|
@@ -9948,22 +10005,22 @@ class Client extends openapi_core_1.default {
|
|
|
9948
10005
|
request.transformationRulesShrink = openapi_core_2.OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.transformationRules, "TransformationRules", "json");
|
|
9949
10006
|
}
|
|
9950
10007
|
let query = {};
|
|
10008
|
+
if (!$dara.isNull(request.DIJobId)) {
|
|
10009
|
+
query["DIJobId"] = request.DIJobId;
|
|
10010
|
+
}
|
|
9951
10011
|
if (!$dara.isNull(request.id)) {
|
|
9952
10012
|
query["Id"] = request.id;
|
|
9953
10013
|
}
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
body["DIJobId"] = request.DIJobId;
|
|
10014
|
+
if (!$dara.isNull(request.projectId)) {
|
|
10015
|
+
query["ProjectId"] = request.projectId;
|
|
9957
10016
|
}
|
|
10017
|
+
let body = {};
|
|
9958
10018
|
if (!$dara.isNull(request.description)) {
|
|
9959
10019
|
body["Description"] = request.description;
|
|
9960
10020
|
}
|
|
9961
10021
|
if (!$dara.isNull(request.jobSettingsShrink)) {
|
|
9962
10022
|
body["JobSettings"] = request.jobSettingsShrink;
|
|
9963
10023
|
}
|
|
9964
|
-
if (!$dara.isNull(request.projectId)) {
|
|
9965
|
-
body["ProjectId"] = request.projectId;
|
|
9966
|
-
}
|
|
9967
10024
|
if (!$dara.isNull(request.resourceSettingsShrink)) {
|
|
9968
10025
|
body["ResourceSettings"] = request.resourceSettingsShrink;
|
|
9969
10026
|
}
|
|
@@ -10834,12 +10891,19 @@ class Client extends openapi_core_1.default {
|
|
|
10834
10891
|
}
|
|
10835
10892
|
async updateResourceAdvance(request, runtime) {
|
|
10836
10893
|
// Step 0: init client
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10894
|
+
if ($dara.isNull(this._credential)) {
|
|
10895
|
+
throw new $OpenApi.ClientError({
|
|
10896
|
+
code: "InvalidCredentials",
|
|
10897
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
10898
|
+
});
|
|
10899
|
+
}
|
|
10900
|
+
let credentialModel = await this._credential.getCredential();
|
|
10901
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
10902
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
10903
|
+
let securityToken = credentialModel.securityToken;
|
|
10904
|
+
let credentialType = credentialModel.type;
|
|
10841
10905
|
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
10842
|
-
if ($dara.isNull(openPlatformEndpoint)) {
|
|
10906
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
10843
10907
|
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
10844
10908
|
}
|
|
10845
10909
|
if ($dara.isNull(credentialType)) {
|
|
@@ -10854,51 +10918,54 @@ class Client extends openapi_core_1.default {
|
|
|
10854
10918
|
protocol: this._protocol,
|
|
10855
10919
|
regionId: this._regionId,
|
|
10856
10920
|
});
|
|
10857
|
-
let authClient = new
|
|
10858
|
-
let authRequest =
|
|
10859
|
-
|
|
10860
|
-
|
|
10921
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
10922
|
+
let authRequest = {
|
|
10923
|
+
Product: "dataworks-public",
|
|
10924
|
+
RegionId: this._regionId,
|
|
10925
|
+
};
|
|
10926
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
10927
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
10861
10928
|
});
|
|
10862
|
-
let
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10929
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
10930
|
+
action: "AuthorizeFileUpload",
|
|
10931
|
+
version: "2019-12-19",
|
|
10932
|
+
protocol: "HTTPS",
|
|
10933
|
+
pathname: "/",
|
|
10934
|
+
method: "GET",
|
|
10935
|
+
authType: "AK",
|
|
10936
|
+
style: "RPC",
|
|
10937
|
+
reqBodyType: "formData",
|
|
10938
|
+
bodyType: "json",
|
|
10869
10939
|
});
|
|
10870
|
-
let
|
|
10871
|
-
let fileObj = new $
|
|
10872
|
-
let ossHeader =
|
|
10873
|
-
let
|
|
10874
|
-
let
|
|
10875
|
-
|
|
10940
|
+
let authResponse = {};
|
|
10941
|
+
let fileObj = new $dara.FileField({});
|
|
10942
|
+
let ossHeader = {};
|
|
10943
|
+
let tmpBody = {};
|
|
10944
|
+
let useAccelerate = false;
|
|
10945
|
+
let authResponseBody = {};
|
|
10876
10946
|
let updateResourceReq = new $_model.UpdateResourceRequest({});
|
|
10877
10947
|
openapi_core_2.OpenApiUtil.convert(request, updateResourceReq);
|
|
10878
10948
|
if (!$dara.isNull(request.resourceFileObject)) {
|
|
10879
|
-
authResponse = await authClient.
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
fileObj = new $
|
|
10884
|
-
filename:
|
|
10949
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
10950
|
+
tmpBody = authResponse["body"];
|
|
10951
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
10952
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
10953
|
+
fileObj = new $dara.FileField({
|
|
10954
|
+
filename: authResponseBody["ObjectKey"],
|
|
10885
10955
|
content: request.resourceFileObject,
|
|
10886
10956
|
contentType: "",
|
|
10887
10957
|
});
|
|
10888
|
-
ossHeader =
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10958
|
+
ossHeader = {
|
|
10959
|
+
host: `${authResponseBody["Bucket"]}.${openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
|
|
10960
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
10961
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
10962
|
+
Signature: authResponseBody["Signature"],
|
|
10963
|
+
key: authResponseBody["ObjectKey"],
|
|
10893
10964
|
file: fileObj,
|
|
10894
|
-
|
|
10895
|
-
}
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
header: ossHeader,
|
|
10899
|
-
});
|
|
10900
|
-
await ossClient.postObject(uploadRequest, ossRuntime);
|
|
10901
|
-
updateResourceReq.resourceFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
|
|
10965
|
+
success_action_status: "201",
|
|
10966
|
+
};
|
|
10967
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
|
|
10968
|
+
updateResourceReq.resourceFile = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
10902
10969
|
}
|
|
10903
10970
|
let updateResourceResp = await this.updateResourceWithOptions(updateResourceReq, runtime);
|
|
10904
10971
|
return updateResourceResp;
|