-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-h1-instances.script
9 lines (6 loc) · 1.43 KB
/
add-h1-instances.script
1
2
3
4
5
6
7
8
9
var dataCenters = new GlideRecord('cmdb_ci_aws_datacenter');
dataCenters.query();
while(dataCenters.next()){
var dataCenterSysID = dataCenters.sys_id.toString();
var inputPayload = '{"items":[{"className":"cmdb_ci_aws_datacenter","values":{"sys_id":"' + dataCenterSysID + '","discovery_source":"ServiceNow"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"h1.2xlarge","memory_mb":"32","vcpus":"8","object_id":"h1.2xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"h1.4xlarge","memory_mb":"64","vcpus":"16","object_id":"h1.4xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"h1.8xlarge","memory_mb":"128","vcpus":"32","object_id":"h1.8xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"h1.16xlarge","memory_mb":"256","vcpus":"64","object_id":"h1.16xlarge"},"lookup":[],"related":[]}],"relations":[{"parent":1,"child":0,"type":"Hosted on::Hosts"},{"parent":2,"child":0,"type":"Hosted on::Hosts"},{"parent":3,"child":0,"type":"Hosted on::Hosts"},{"parent":4,"child":0,"type":"Hosted on::Hosts"}]}';
SNC.IdentificationEngineScriptableApi.createOrUpdateCI('ServiceNow',inputPayload); }