You need to have curl installed for these commands to work or you could use a REST client.
I didn't make a script because these only need to be run once to create the fields. Change the label and descriptions as needed before using.
Devices Strings
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>City Code</Label><Description>City Code</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrString1</AttributeName><Type>String</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>Location Type</Label><Description>Location Type</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrString2</AttributeName><Type>String</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>non-proprietary</Label><Description>non-proprietary</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrString3</AttributeName><Type>String</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceString4 Future</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrString4</AttributeName><Type>String</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceString5 Future</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrString5</AttributeName><Type>String</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
Devices Integers
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceInt 1</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrInt1</AttributeName><Type>Integer</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceInt 2</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrInt2</AttributeName><Type>Integer</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceInt 3</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrInt3</AttributeName><Type>Integer</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceInt 4</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrInt4</AttributeName><Type>Integer</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>DeviceInt 5</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>DeviceAttrInt5</AttributeName><Type>Integer</Type><ItemType>Device</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
Interface Strings
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>City Code</Label><Description>City Code</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrString1</AttributeName><Type>String</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>Location Type</Label><Description>Location Type</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrString2</AttributeName><Type>String</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>non-proprietary</Label><Description>non-proprietary</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrString3</AttributeName><Type>String</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>Provider</Label><Description>Provider</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrString4</AttributeName><Type>String</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>PortString5</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrString5</AttributeName><Type>String</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
Interface Integers
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>Upgrade Status</Label><Description>0 No Status; 1 Identified for Upgrade; 2 Circuits ordered and or actively being worked</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrInt1</AttributeName><Type>Integer</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>Report Inclusion</Label><Description>Report Inclusion</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrInt2</AttributeName><Type>Integer</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>PortInt 3</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrInt3</AttributeName><Type>Integer</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>PortInt 4</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrInt4</AttributeName><Type>Integer</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
curl --silent --request POST -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>PortInt 5</Label><Description>Future Use</Description><Hidden>false</Hidden><Storage><AttributeName>PortAttrInt5</AttributeName><Type>Integer</Type><ItemType>Port</ItemType></Storage></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition
To see all custom attributes that were created and their ID's for updating.
http://DataAggServer:8581/rest/customattributedefinition
To change the Label or Description values, use the following command.
Change NewLabel and NewDescription to the desired text and replace <ID> with the number found from the URL above.
curl --silent --request PUT -H "Content-Type: application/xml" -d "<CustomAttributeDefinition version='1.0.0'><Label>NewLabel</Label><Description>NewDescription</Description><Hidden>false</Hidden></CustomAttributeDefinition>" http://DataAggServer:8581/rest/customattributedefinition/<ID>