-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-m5-instances.script
10 lines (7 loc) · 1.93 KB
/
add-m5-instances.script
1
2
3
4
5
6
7
8
9
10
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":"m5.large","memory_mb":"8","vcpus":"2","object_id":"m5.large"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"m5.2large","memory_mb":"16","vcpus":"4","object_id":"m5.xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"m5.2xlarge","memory_mb":"32","vcpus":"8","object_id":"m5.2xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"m5.4xlarge","memory_mb":"64","vcpus":"16","object_id":"m5.4xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"m5.12xlarge","memory_mb":"192","vcpus":"48","object_id":"m5.12xlarge"},"lookup":[],"related":[]},{"className":"cmdb_ci_compute_template","values":{"local_storage_gb":"0","discovery_source":"ServiceNow","name":"m5.24xlarge","memory_mb":"384","vcpus":"96","object_id":"m5.24xlarge"},"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"},{"parent":5,"child":0,"type":"Hosted on::Hosts"},{"parent":6,"child":0,"type":"Hosted on::Hosts"}]}';
SNC.IdentificationEngineScriptableApi.createOrUpdateCI('ServiceNow',inputPayload);
}