@itentialopensource/adapter-six_connect 0.6.1 → 0.7.1
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/CHANGELOG.md +16 -0
- package/adapter.js +130 -11
- package/entities/ipam/action.json +21 -0
- package/entities/ipam/schema.json +9 -8
- package/package.json +1 -1
- package/pronghorn.json +172 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +7 -7
- package/test/integration/adapterTestIntegration.js +54 -0
- package/test/unit/adapterTestUnit.js +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.7.1 [03-14-2023]
|
|
3
|
+
|
|
4
|
+
* Add a task to ipam entity
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/controller-orchestrator/adapter-six_connect!11
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.7.0 [07-25-2022]
|
|
11
|
+
|
|
12
|
+
* Changes for smartAssign -- added smartAssignTags and smartAssignObject for requested changes
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/controller-orchestrator/adapter-six_connect!10
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 0.6.1 [06-04-2022]
|
|
3
19
|
|
|
4
20
|
* Add schema for query parameter changes in names
|
package/adapter.js
CHANGED
|
@@ -2104,12 +2104,63 @@ class SixConnect extends AdapterBaseCl {
|
|
|
2104
2104
|
* @summary Smart assign by using Resource ID
|
|
2105
2105
|
*
|
|
2106
2106
|
* @function smartAssign
|
|
2107
|
-
* @param {
|
|
2107
|
+
* @param {string} type - type for assignment
|
|
2108
|
+
* @param {number} rir - rir for assignment
|
|
2109
|
+
* @param {string} mask - mask for assignment
|
|
2110
|
+
* @param {string} resource_id - resource_id for assignment
|
|
2111
|
+
* @param {string} region_id - region_id for assignment
|
|
2108
2112
|
* @param {getCallback} callback - a callback function to return the result
|
|
2109
2113
|
*/
|
|
2110
2114
|
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
2111
2115
|
smartAssign(type, rir, mask, resource_id, region_id, callback) {
|
|
2112
|
-
const
|
|
2116
|
+
const bodyVars = {
|
|
2117
|
+
type,
|
|
2118
|
+
rir,
|
|
2119
|
+
mask,
|
|
2120
|
+
resource_id,
|
|
2121
|
+
region_id,
|
|
2122
|
+
tags_mode: 'intersection'
|
|
2123
|
+
};
|
|
2124
|
+
this.smartAssignObject(bodyVars, callback);
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* @summary Smart assign by using Resource ID with Tags
|
|
2129
|
+
*
|
|
2130
|
+
* @function smartAssignTags
|
|
2131
|
+
* @param {string} type - type for assignment
|
|
2132
|
+
* @param {number} rir - rir for assignment
|
|
2133
|
+
* @param {string} mask - mask for assignment
|
|
2134
|
+
* @param {string} resource_id - resource_id for assignment
|
|
2135
|
+
* @param {string} region_id - region_id for assignment
|
|
2136
|
+
* @param {array} tags - tags for assignment
|
|
2137
|
+
* @param {string} tags_mode - tags_mode for assignment
|
|
2138
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
2139
|
+
*/
|
|
2140
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
2141
|
+
smartAssignTags(type, rir, mask, resource_id, region_id, tags, tags_mode, callback) {
|
|
2142
|
+
const bodyVars = {
|
|
2143
|
+
type,
|
|
2144
|
+
rir,
|
|
2145
|
+
mask,
|
|
2146
|
+
resource_id,
|
|
2147
|
+
region_id,
|
|
2148
|
+
tags,
|
|
2149
|
+
tags_mode
|
|
2150
|
+
};
|
|
2151
|
+
this.smartAssignObject(bodyVars, callback);
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
/**
|
|
2155
|
+
* @summary Smart assign by using Full Body
|
|
2156
|
+
*
|
|
2157
|
+
* @function smartAssignObject
|
|
2158
|
+
* @param {object} body - body param
|
|
2159
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
2160
|
+
*/
|
|
2161
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
2162
|
+
smartAssignObject(body, callback) {
|
|
2163
|
+
const meth = 'adapter-smartAssignObject';
|
|
2113
2164
|
const origin = `${this.id}-${meth}`;
|
|
2114
2165
|
log.trace(origin);
|
|
2115
2166
|
|
|
@@ -2124,14 +2175,7 @@ class SixConnect extends AdapterBaseCl {
|
|
|
2124
2175
|
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
2125
2176
|
const queryParams = {};
|
|
2126
2177
|
const pathVars = [];
|
|
2127
|
-
const bodyVars =
|
|
2128
|
-
type,
|
|
2129
|
-
rir,
|
|
2130
|
-
mask,
|
|
2131
|
-
resource_id,
|
|
2132
|
-
region_id,
|
|
2133
|
-
tags_mode: 'intersection'
|
|
2134
|
-
};
|
|
2178
|
+
const bodyVars = body;
|
|
2135
2179
|
|
|
2136
2180
|
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
|
|
2137
2181
|
const reqObj = {
|
|
@@ -2151,7 +2195,7 @@ class SixConnect extends AdapterBaseCl {
|
|
|
2151
2195
|
return callback(null, irReturnError);
|
|
2152
2196
|
}
|
|
2153
2197
|
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
2154
|
-
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['
|
|
2198
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['smartAssignObject'], null, null, null);
|
|
2155
2199
|
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
2156
2200
|
return callback(null, errorObj);
|
|
2157
2201
|
}
|
|
@@ -7254,6 +7298,81 @@ class SixConnect extends AdapterBaseCl {
|
|
|
7254
7298
|
}
|
|
7255
7299
|
}
|
|
7256
7300
|
|
|
7301
|
+
/**
|
|
7302
|
+
* @summary CREATE IPAM Swip
|
|
7303
|
+
*
|
|
7304
|
+
* @function postIpamSwip
|
|
7305
|
+
* @param {string} netblockId - netblock id
|
|
7306
|
+
* @param {object} body - body param
|
|
7307
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
7308
|
+
*/
|
|
7309
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
7310
|
+
postIpamSwip(netblockId, body, callback) {
|
|
7311
|
+
const meth = 'adapter-postIpamSwip';
|
|
7312
|
+
const origin = `${this.id}-${meth}`;
|
|
7313
|
+
log.trace(origin);
|
|
7314
|
+
|
|
7315
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
7316
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
7317
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
7318
|
+
return callback(null, errorObj);
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
7322
|
+
if (netblockId === undefined || netblockId === null || netblockId === '') {
|
|
7323
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['netblockId'], null, null, null);
|
|
7324
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
7325
|
+
return callback(null, errorObj);
|
|
7326
|
+
}
|
|
7327
|
+
|
|
7328
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
7329
|
+
const queryParamsAvailable = {};
|
|
7330
|
+
const queryParams = {};
|
|
7331
|
+
const pathVars = [netblockId];
|
|
7332
|
+
const bodyVars = body;
|
|
7333
|
+
|
|
7334
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
7335
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
7336
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
7337
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
7338
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
7339
|
+
}
|
|
7340
|
+
});
|
|
7341
|
+
|
|
7342
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders
|
|
7343
|
+
const reqObj = {
|
|
7344
|
+
payload: bodyVars,
|
|
7345
|
+
uriPathVars: pathVars,
|
|
7346
|
+
uriQuery: queryParams
|
|
7347
|
+
};
|
|
7348
|
+
|
|
7349
|
+
try {
|
|
7350
|
+
// Make the call -
|
|
7351
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
7352
|
+
return this.requestHandlerInst.identifyRequest('ipam', 'postIpamSwip', reqObj, true, (irReturnData, irReturnError) => {
|
|
7353
|
+
// if we received an error or their is no response on the results
|
|
7354
|
+
// return an error
|
|
7355
|
+
if (irReturnError) {
|
|
7356
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
7357
|
+
return callback(null, irReturnError);
|
|
7358
|
+
}
|
|
7359
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
7360
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['postIpamSwip'], null, null, null);
|
|
7361
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
7362
|
+
return callback(null, errorObj);
|
|
7363
|
+
}
|
|
7364
|
+
|
|
7365
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
7366
|
+
// return the response
|
|
7367
|
+
return callback(irReturnData, null);
|
|
7368
|
+
});
|
|
7369
|
+
} catch (ex) {
|
|
7370
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
7371
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
7372
|
+
return callback(null, errorObj);
|
|
7373
|
+
}
|
|
7374
|
+
}
|
|
7375
|
+
|
|
7257
7376
|
/**
|
|
7258
7377
|
* @summary Get workflows
|
|
7259
7378
|
*
|
|
@@ -1805,6 +1805,27 @@
|
|
|
1805
1805
|
"mockFile": ""
|
|
1806
1806
|
}
|
|
1807
1807
|
]
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
"name": "postIpamSwip",
|
|
1811
|
+
"protocol": "REST",
|
|
1812
|
+
"method": "POST",
|
|
1813
|
+
"entitypath": "{base_path}/{version}/ipam/swip/{pathv1}/simple?{query}",
|
|
1814
|
+
"requestSchema": "schema.json",
|
|
1815
|
+
"responseSchema": "schema.json",
|
|
1816
|
+
"timeout": 0,
|
|
1817
|
+
"sendEmpty": false,
|
|
1818
|
+
"sendGetBody": false,
|
|
1819
|
+
"requestDatatype": "JSON",
|
|
1820
|
+
"responseDatatype": "JSON",
|
|
1821
|
+
"headers": {},
|
|
1822
|
+
"responseObjects": [
|
|
1823
|
+
{
|
|
1824
|
+
"type": "default",
|
|
1825
|
+
"key": "",
|
|
1826
|
+
"mockFile": ""
|
|
1827
|
+
}
|
|
1828
|
+
]
|
|
1808
1829
|
}
|
|
1809
1830
|
]
|
|
1810
1831
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$id": "schema.json",
|
|
3
3
|
"type": "object",
|
|
4
4
|
"schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"translate":
|
|
5
|
+
"translate": true,
|
|
6
6
|
"dynamicfields": true,
|
|
7
7
|
"properties": {
|
|
8
8
|
"ph_request_type": {
|
|
@@ -95,12 +95,13 @@
|
|
|
95
95
|
"getVlanDomains",
|
|
96
96
|
"retrieveDomainVlan",
|
|
97
97
|
"retrieveVlan",
|
|
98
|
-
"getSizeSizes"
|
|
98
|
+
"getSizeSizes",
|
|
99
|
+
"postIpamSwip"
|
|
99
100
|
],
|
|
100
101
|
"external_name": "ph_request_type"
|
|
101
102
|
},
|
|
102
103
|
"lirId": {
|
|
103
|
-
"type": "string",
|
|
104
|
+
"type": ["string", "number"],
|
|
104
105
|
"description": "lir id",
|
|
105
106
|
"parse": false,
|
|
106
107
|
"encode": false,
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
"external_name": "lir_id"
|
|
112
113
|
},
|
|
113
114
|
"regionId": {
|
|
114
|
-
"type": "string",
|
|
115
|
+
"type": ["string", "number"],
|
|
115
116
|
"description": "region id",
|
|
116
117
|
"parse": false,
|
|
117
118
|
"encode": false,
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
"external_name": "region_id"
|
|
123
124
|
},
|
|
124
125
|
"resourceId": {
|
|
125
|
-
"type": "string",
|
|
126
|
+
"type": ["string", "number"],
|
|
126
127
|
"description": "resource id",
|
|
127
128
|
"parse": false,
|
|
128
129
|
"encode": false,
|
|
@@ -133,7 +134,7 @@
|
|
|
133
134
|
"external_name": "resource_id"
|
|
134
135
|
},
|
|
135
136
|
"vlanId": {
|
|
136
|
-
"type": "string",
|
|
137
|
+
"type": ["string", "number"],
|
|
137
138
|
"description": "vlan id",
|
|
138
139
|
"parse": false,
|
|
139
140
|
"encode": false,
|
|
@@ -144,7 +145,7 @@
|
|
|
144
145
|
"external_name": "vlan_id"
|
|
145
146
|
},
|
|
146
147
|
"ruleId": {
|
|
147
|
-
"type": "string",
|
|
148
|
+
"type": ["string", "number"],
|
|
148
149
|
"description": "rule id",
|
|
149
150
|
"parse": false,
|
|
150
151
|
"encode": false,
|
|
@@ -155,7 +156,7 @@
|
|
|
155
156
|
"external_name": "rule_id"
|
|
156
157
|
},
|
|
157
158
|
"orgId": {
|
|
158
|
-
"type": "string",
|
|
159
|
+
"type": ["string", "number"],
|
|
159
160
|
"description": "org id",
|
|
160
161
|
"parse": false,
|
|
161
162
|
"encode": false,
|
package/package.json
CHANGED
package/pronghorn.json
CHANGED
|
@@ -1918,6 +1918,134 @@
|
|
|
1918
1918
|
},
|
|
1919
1919
|
"task": true
|
|
1920
1920
|
},
|
|
1921
|
+
{
|
|
1922
|
+
"name": "smartAssignTags",
|
|
1923
|
+
"summary": "Smart assign by using Resource ID",
|
|
1924
|
+
"description": "Smart assign by using Resource ID",
|
|
1925
|
+
"input": [
|
|
1926
|
+
{
|
|
1927
|
+
"name": "type",
|
|
1928
|
+
"type": "string",
|
|
1929
|
+
"info": "",
|
|
1930
|
+
"required": true,
|
|
1931
|
+
"schema": {
|
|
1932
|
+
"title": "type",
|
|
1933
|
+
"type": "string"
|
|
1934
|
+
}
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
"name": "rir",
|
|
1938
|
+
"type": "string",
|
|
1939
|
+
"info": "",
|
|
1940
|
+
"required": true,
|
|
1941
|
+
"schema": {
|
|
1942
|
+
"title": "rir",
|
|
1943
|
+
"type": "string"
|
|
1944
|
+
}
|
|
1945
|
+
},
|
|
1946
|
+
{
|
|
1947
|
+
"name": "mask",
|
|
1948
|
+
"type": "string",
|
|
1949
|
+
"info": "",
|
|
1950
|
+
"required": true,
|
|
1951
|
+
"schema": {
|
|
1952
|
+
"title": "mask",
|
|
1953
|
+
"type": "string"
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
"name": "resource_id",
|
|
1958
|
+
"type": "string",
|
|
1959
|
+
"info": "",
|
|
1960
|
+
"required": true,
|
|
1961
|
+
"schema": {
|
|
1962
|
+
"title": "resource_id",
|
|
1963
|
+
"type": "string"
|
|
1964
|
+
}
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
"name": "region_id",
|
|
1968
|
+
"type": "string",
|
|
1969
|
+
"info": "",
|
|
1970
|
+
"required": true,
|
|
1971
|
+
"schema": {
|
|
1972
|
+
"title": "region_id",
|
|
1973
|
+
"type": "string"
|
|
1974
|
+
}
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
"name": "tags",
|
|
1978
|
+
"type": "array",
|
|
1979
|
+
"info": "",
|
|
1980
|
+
"required": true,
|
|
1981
|
+
"schema": {
|
|
1982
|
+
"title": "tags",
|
|
1983
|
+
"type": "array"
|
|
1984
|
+
}
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
"name": "tags_mode",
|
|
1988
|
+
"type": "string",
|
|
1989
|
+
"info": "",
|
|
1990
|
+
"required": true,
|
|
1991
|
+
"schema": {
|
|
1992
|
+
"title": "tags_mode",
|
|
1993
|
+
"type": "string"
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
],
|
|
1997
|
+
"output": {
|
|
1998
|
+
"name": "result",
|
|
1999
|
+
"type": "object",
|
|
2000
|
+
"description": "A JSON Object containing status, code and the result",
|
|
2001
|
+
"schema": {
|
|
2002
|
+
"title": "result",
|
|
2003
|
+
"type": "object"
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2006
|
+
"roles": [
|
|
2007
|
+
"admin"
|
|
2008
|
+
],
|
|
2009
|
+
"route": {
|
|
2010
|
+
"verb": "POST",
|
|
2011
|
+
"path": "/smartAssignTags"
|
|
2012
|
+
},
|
|
2013
|
+
"task": true
|
|
2014
|
+
},
|
|
2015
|
+
{
|
|
2016
|
+
"name": "smartAssignObject",
|
|
2017
|
+
"summary": "Smart assign by using Resource ID",
|
|
2018
|
+
"description": "Smart assign by using Resource ID",
|
|
2019
|
+
"input": [
|
|
2020
|
+
{
|
|
2021
|
+
"name": "body",
|
|
2022
|
+
"type": "object",
|
|
2023
|
+
"info": "",
|
|
2024
|
+
"required": true,
|
|
2025
|
+
"schema": {
|
|
2026
|
+
"title": "body",
|
|
2027
|
+
"type": "object"
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
],
|
|
2031
|
+
"output": {
|
|
2032
|
+
"name": "result",
|
|
2033
|
+
"type": "object",
|
|
2034
|
+
"description": "A JSON Object containing status, code and the result",
|
|
2035
|
+
"schema": {
|
|
2036
|
+
"title": "result",
|
|
2037
|
+
"type": "object"
|
|
2038
|
+
}
|
|
2039
|
+
},
|
|
2040
|
+
"roles": [
|
|
2041
|
+
"admin"
|
|
2042
|
+
],
|
|
2043
|
+
"route": {
|
|
2044
|
+
"verb": "POST",
|
|
2045
|
+
"path": "/smartAssignObject"
|
|
2046
|
+
},
|
|
2047
|
+
"task": true
|
|
2048
|
+
},
|
|
1921
2049
|
{
|
|
1922
2050
|
"name": "deleteSwip1",
|
|
1923
2051
|
"summary": "Deassign by using Netblock CIDR",
|
|
@@ -4959,6 +5087,50 @@
|
|
|
4959
5087
|
},
|
|
4960
5088
|
"task": true
|
|
4961
5089
|
},
|
|
5090
|
+
{
|
|
5091
|
+
"name": "postIpamSwip",
|
|
5092
|
+
"summary": "Create IPAM Swip",
|
|
5093
|
+
"description": "Creates a new IPAM swip.",
|
|
5094
|
+
"input": [
|
|
5095
|
+
{
|
|
5096
|
+
"name": "netblockId",
|
|
5097
|
+
"type": "string",
|
|
5098
|
+
"info": "",
|
|
5099
|
+
"required": true,
|
|
5100
|
+
"schema": {
|
|
5101
|
+
"title": "netblockId",
|
|
5102
|
+
"type": "string"
|
|
5103
|
+
}
|
|
5104
|
+
},
|
|
5105
|
+
{
|
|
5106
|
+
"name": "body",
|
|
5107
|
+
"type": "object",
|
|
5108
|
+
"info": "",
|
|
5109
|
+
"required": false,
|
|
5110
|
+
"schema": {
|
|
5111
|
+
"title": "body",
|
|
5112
|
+
"type": "object"
|
|
5113
|
+
}
|
|
5114
|
+
}
|
|
5115
|
+
],
|
|
5116
|
+
"output": {
|
|
5117
|
+
"name": "result",
|
|
5118
|
+
"type": "object",
|
|
5119
|
+
"description": "A JSON Object containing status, code and the result",
|
|
5120
|
+
"schema": {
|
|
5121
|
+
"title": "result",
|
|
5122
|
+
"type": "object"
|
|
5123
|
+
}
|
|
5124
|
+
},
|
|
5125
|
+
"roles": [
|
|
5126
|
+
"admin"
|
|
5127
|
+
],
|
|
5128
|
+
"route": {
|
|
5129
|
+
"verb": "POST",
|
|
5130
|
+
"path": "/postIpamSwip"
|
|
5131
|
+
},
|
|
5132
|
+
"task": true
|
|
5133
|
+
},
|
|
4962
5134
|
{
|
|
4963
5135
|
"name": "getWorkflows",
|
|
4964
5136
|
"summary": "Get workflows",
|
|
Binary file
|
package/report/adapterInfo.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"configLines":
|
|
2
|
+
"version": "0.7.0",
|
|
3
|
+
"configLines": 13480,
|
|
4
4
|
"scriptLines": 1707,
|
|
5
|
-
"codeLines":
|
|
6
|
-
"testLines":
|
|
7
|
-
"testCases":
|
|
8
|
-
"totalCodeLines":
|
|
9
|
-
"wfTasks":
|
|
5
|
+
"codeLines": 19007,
|
|
6
|
+
"testLines": 11198,
|
|
7
|
+
"testCases": 527,
|
|
8
|
+
"totalCodeLines": 31912,
|
|
9
|
+
"wfTasks": 236
|
|
10
10
|
}
|
|
@@ -4655,5 +4655,59 @@ describe('[integration] Six_connect Adapter Test', () => {
|
|
|
4655
4655
|
}
|
|
4656
4656
|
}).timeout(attemptTimeout);
|
|
4657
4657
|
});
|
|
4658
|
+
|
|
4659
|
+
describe('#getNetblocks - errors', () => {
|
|
4660
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4661
|
+
try {
|
|
4662
|
+
a.getNetblocks('fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', 'fakedata', (data, error) => {
|
|
4663
|
+
try {
|
|
4664
|
+
if (stub) {
|
|
4665
|
+
log.error(data);
|
|
4666
|
+
} else {
|
|
4667
|
+
log.error(data);
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4670
|
+
done();
|
|
4671
|
+
} catch (err) {
|
|
4672
|
+
log.error(`Test Failure: ${err}`);
|
|
4673
|
+
done(err);
|
|
4674
|
+
}
|
|
4675
|
+
});
|
|
4676
|
+
} catch (error) {
|
|
4677
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4678
|
+
done(error);
|
|
4679
|
+
}
|
|
4680
|
+
}).timeout(attemptTimeout);
|
|
4681
|
+
});
|
|
4682
|
+
|
|
4683
|
+
const postIpamSwipBodyParam = {
|
|
4684
|
+
lir_id: '16',
|
|
4685
|
+
entity_handle: 'ZAYOB',
|
|
4686
|
+
net_handle: 'ZAYO-IPYX-123456'
|
|
4687
|
+
};
|
|
4688
|
+
describe('#postIpamSwip - errors', () => {
|
|
4689
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4690
|
+
try {
|
|
4691
|
+
a.postIpamSwip('fakedata', postIpamSwipBodyParam, (data, error) => {
|
|
4692
|
+
try {
|
|
4693
|
+
if (stub) {
|
|
4694
|
+
const displayE = 'Error 400 received on request';
|
|
4695
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-six_connect-connectorRest-handleEndResponse', displayE);
|
|
4696
|
+
} else {
|
|
4697
|
+
runCommonAsserts(data, error);
|
|
4698
|
+
}
|
|
4699
|
+
saveMockData('ipam', 'postIpamSwip', 'default', data);
|
|
4700
|
+
done();
|
|
4701
|
+
} catch (err) {
|
|
4702
|
+
log.error(`Test Failure: ${err}`);
|
|
4703
|
+
done(err);
|
|
4704
|
+
}
|
|
4705
|
+
});
|
|
4706
|
+
} catch (error) {
|
|
4707
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4708
|
+
done(error);
|
|
4709
|
+
}
|
|
4710
|
+
}).timeout(attemptTimeout);
|
|
4711
|
+
});
|
|
4658
4712
|
});
|
|
4659
4713
|
});
|
|
@@ -5320,5 +5320,34 @@ describe('[unit] Six_connect Adapter Test', () => {
|
|
|
5320
5320
|
}
|
|
5321
5321
|
}).timeout(attemptTimeout);
|
|
5322
5322
|
});
|
|
5323
|
+
|
|
5324
|
+
describe('#postIpamSwip - errors', () => {
|
|
5325
|
+
it('should have a postIpamSwip function', (done) => {
|
|
5326
|
+
try {
|
|
5327
|
+
assert.equal(true, typeof a.postIpamSwip === 'function');
|
|
5328
|
+
done();
|
|
5329
|
+
} catch (error) {
|
|
5330
|
+
log.error(`Test Failure: ${error}`);
|
|
5331
|
+
done(error);
|
|
5332
|
+
}
|
|
5333
|
+
}).timeout(attemptTimeout);
|
|
5334
|
+
it('should error if - missing netblockId', (done) => {
|
|
5335
|
+
try {
|
|
5336
|
+
a.postIpamSwip(null, null, (data, error) => {
|
|
5337
|
+
try {
|
|
5338
|
+
const displayE = 'netblockId is required';
|
|
5339
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-six_connect-adapter-postIpamSwip', displayE);
|
|
5340
|
+
done();
|
|
5341
|
+
} catch (err) {
|
|
5342
|
+
log.error(`Test Failure: ${err}`);
|
|
5343
|
+
done(err);
|
|
5344
|
+
}
|
|
5345
|
+
});
|
|
5346
|
+
} catch (error) {
|
|
5347
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5348
|
+
done(error);
|
|
5349
|
+
}
|
|
5350
|
+
}).timeout(attemptTimeout);
|
|
5351
|
+
});
|
|
5323
5352
|
});
|
|
5324
5353
|
});
|