diff --git a/article/object-filters/index.html b/article/object-filters/index.html index a0edfe9113c..aa470ce44f8 100644 --- a/article/object-filters/index.html +++ b/article/object-filters/index.html @@ -202,32 +202,32 @@
operation = 'isDate'
options = [{
'name': 'date',
- 'value': '01/01/01'
+ 'value': ['01/01/01']
}
]
operation = 'lessThanDate'
options = [{
'name': 'date',
- 'value: '01/01/01'
+ 'value: ['01/01/01']
}
]
operation = 'greaterThanDate'
options = [{
'name': 'date',
- 'value: '01/01/01'
+ 'value: ['01/01/01']
}
]
operation = 'betweenDate'
options = [{
'name': 'startDate',
- 'value: '01/01/01'
+ 'value: ['01/01/01']
},
{
'name': 'endDate',
- 'value': '01/02/01
+ 'value': ['01/02/01]
}
]
softlayer_container_product_order_gateway_appliance_cluster
softlayer_container_product_order_hardware_server_gateway_appliance
This example goes over how to order a Single or HA vyatta with a bunch of optional settings. More context around ordering can be found in https://softlayer.github.io/python/orderBareMetal/ and https://softlayer.github.io/python/ordering_slcli/
+import SoftLayer
+from SoftLayer.managers import ordering
+import sys
+from pprint import pprint as pp
+import logging
+
+
+logging.debug("Starting up")
+# Requires softlayer-python 5.4.3+
+
+class vyattaOrderer():
+
+ def __init__(self):
+ if SoftLayer.__version__ < 'v5.4.3':
+ print("SoftLayer needs to be 5.4.3+, is currently %s" % SoftLayer.__version__)
+ self.client = SoftLayer.Client()
+ # slcli order package-list --package_type BARE_METAL_GATEWAY
+ # Will get you available package keynames
+ self.package_keyname = "2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS"
+ self.complex_type = 'SoftLayer_Container_Product_Order_Hardware_Server_Gateway_Appliance'
+
+
+ def orderVyatta(self, dc, pub_vlan='', prv_vlan=''):
+ """Actually orders a vyatts
+ Required
+ - dc
+ - Server Chassis
+ - RAM
+ - OS (not really though)
+ - HD (number, raid, partition)
+ - Bandwidth
+ - Port Speed
+ - IPv6
+ Options
+ - vlans
+ - provision scrips
+ - ssh keys
+ - userdata
+ - hostname, domain
+ """
+
+ order_svc = self.client['Product_Order']
+
+ order_items = self.itemKeynameList()
+
+ extras = {}
+ extras['hardware'] = [
+ self.generateHardwareEntry('vyatta1', 'test.com', pub_vlan, prv_vlan, 'vyatta1 Test')
+ ]
+ extras['storageGroups'] = [self.generateRaidEntry()]
+ extras['sshKeys'] = [{'sshKeyIds': [87634]}]
+ extras['provisionScripts'] = [
+ 'https://raw.githubusercontent.com/softlayer/softlayer.github.io/master/provision-test.sh'
+ ]
+
+ vyatta_order = self.getOrderObject(dc, order_items, extras, 1)
+ order_object = {
+ 'orderContainers': [
+ vyatta_order
+ ]
+ }
+
+ verify = order_svc.verifyOrder(order_object)
+ # verify = order_svc.placeOrder(order_object)
+ pp(verify)
+ print("done")
+
+ def orderVyattaHA(self, dc, pub_vlan='', prv_vlan=''):
+ order_svc = self.client['Product_Order']
+ om = ordering.OrderingManager(self.client)
+
+ order_items = self.itemKeynameList()
+
+ extras = {}
+ extras['hardware'] = [
+ self.generateHardwareEntry('vyatta1', 'test.com', pub_vlan, prv_vlan, 'vyatta1 Test'),
+ self.generateHardwareEntry('vyatta2', 'test.com', pub_vlan, prv_vlan, 'vyatta2 Test')
+ ]
+ extras['storageGroups'] = [self.generateRaidEntry()]
+ mySshKey = 87634
+ extras['sshKeys'] = [{'sshKeyIds': [mySshKey]}, {'sshKeyIds': [mySshKey]}]
+ # Each server needs a provision script
+ extras['provisionScripts'] = [
+ 'https://raw.githubusercontent.com/softlayer/softlayer.github.io/master/provision-test.sh',
+ 'https://raw.githubusercontent.com/softlayer/softlayer.github.io/master/provision-test.sh'
+ ]
+ extras['clusterIdentifier'] = 'myTestClusterOfVyattas'
+
+ vyatta_order = self.getOrderObject(dc, order_items, extras, 2)
+
+ cluster_extras = {
+ 'clusterIdentifier': 'myTestClusterOfVyattas',
+ "sshKeys": [{"sshKeyIds": [mySshKey]}]
+ }
+ cluster_type = "SoftLayer_Container_Product_Order_Gateway_Appliance_Cluster"
+ cluster_object = om.generate_order('NETWORK_GATEWAY_APPLIANCE_CLUSTER', dc, ['GATEWAY_APPLIANCE_CLUSTER'],
+ cluster_type, False, None, cluster_extras, 1)
+ # the cluster order object is a bit special, and we need to remove these for it to work properly
+ del cluster_object['location']
+ del cluster_object['useHourlyPricing']
+ order_object = {
+ 'orderContainers': [
+ vyatta_order,
+ cluster_object
+ ]
+ }
+
+ verify = order_svc.verifyOrder(order_object)
+ # verify = order_svc.placeOrder(order_object)
+ pp(verify)
+ print("done")
+
+
+ def generateHardwareEntry(self, hostname, domain, prv_vlan='', pub_vlan='', userData=''):
+ hardware = {
+ 'domain': domain,
+ 'hostname': hostname,
+ 'primaryBackendNetworkComponent':
+ {'networkVlan': {'id' : int(pub_vlan)}},
+ 'primaryNetworkComponent':
+ {'networkVlan': {'id' : int(prv_vlan)}},
+ 'userData': [{'value': userData}]
+ }
+ return hardware
+
+ def generateRaidEntry(self):
+ storage = {
+ 'arrayTypeId': 2,
+ 'hardDrives': [0,1],
+ 'partitionTemplateId': 1
+ }
+ return storage
+
+ def getOrderObject(self, dc, items, extras, quantity = 1):
+ """Uses the ordering manager to build a order object"""
+ om = ordering.OrderingManager(self.client)
+ order = om.generate_order(self.package_keyname, dc, items, self.complex_type, False, None, extras, quantity)
+ # pp(order)
+ return order
+
+
+
+ def datacenterList(self):
+ """Prints a list of dcs and their ids"""
+ om = ordering.OrderingManager(self.client)
+ locations = om.package_locations(self.package_keyname)
+ print("ID, name, longName")
+ for region in locations:
+ for location in region['locations']:
+ if location['locationPackageDetails'][0]['isAvailable'] == 1:
+ dc = location['location']
+ print("%s, %s, %s" % (dc['id'], dc['name'], dc['longName']))
+
+
+ def itemKeynameList(self):
+ """Builds a list of item keyNames needed to order a VYATTA
+
+ To see what category of items are required, use this command
+ $> slcli order category-list 2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS
+
+ To see what items are in each category, use this command
+ $> slcli order item-list 2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS
+
+ Price Ids are subject to change, so please use keynames to get price ids
+ at order time.
+ """
+
+ # The junk all orders have to have
+ required_items = [
+ 'AUTOMATED_NOTIFICATION',
+ 'MONITORING_HOST_PING',
+ 'NOTIFICATION_EMAIL_AND_TICKET',
+ 'REBOOT_KVM_OVER_IP',
+ 'NESSUS_VULNERABILITY_ASSESSMENT_REPORTING',
+ 'UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT',
+ 'REDUNDANT_POWER_SUPPLY',
+ ]
+
+ # 20000GB is recommended.
+ # BANDWIDTH_0_GB_2 and BANDWIDTH_UNLIMITED_100_MBPS_UPLINK are also possible
+ network_items = [
+ 'BANDWIDTH_20000_GB',
+ '10_GBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS',
+ '1_IP_ADDRESS',
+ '1_IPV6_ADDRESS'
+ ]
+
+ # Were going to go with RAID1, 500GB.
+ hard_drive = [
+ 'HARD_DRIVE_500GB_SATA_II',
+ 'HARD_DRIVE_500GB_SATA_II',
+ 'DISK_CONTROLLER_RAID_1'
+ ]
+
+ ram = [
+ # 'RAM_16_GB_DDR3_1333_ECC_REG'
+ 'RAM_32_GB_DDR3_1333_REG_2',
+ # 'RAM_64_GB_DDR3_1333_REG_2'
+ # 'RAM_48_GB_DDR3_1333_REG'
+ # 'RAM_96_GB_DDR3_1333_REG'
+ # 'RAM_128_GB_DDR3_1333_REG_2'
+ # 'RAM_256_GB_DDR3_1333_REG_2'
+ ]
+
+ # Sets the server chassis and OS
+ server = [
+ 'OS_VYATTA_5600_5_X_UP_TO_20GBPS_SUBSCRIPTION_EDITION_64_BIT',
+ 'INTEL_XEON_2620_2_40',
+ # 'INTEL_INTEL_XEON_E52620_V4_2_10'
+ # 'INTEL_XEON_2650_2_30'
+ # 'INTEL_INTEL_XEON_E52650_V4_2_20'
+ # 'INTEL_XEON_2690_2_60'
+ # 'INTEL_INTEL_XEON_E52690_V4_2_60'
+ ]
+
+ allItems = required_items + network_items + hard_drive + ram + server
+ return allItems
+
+ def listAvailableVlans(self, dc_id):
+ """Will find available VLANs that a vyatta can be ordered on"""
+
+ mask = """mask[
+ network, type, primaryRouter[datacenter],
+ attachedNetworkGatewayFlag, dedicatedFirewallFlag
+ ]"""
+
+ _filter = {
+ 'networkVlans' : {
+ 'primaryRouter': {
+ 'datacenter' : { 'id': {'operation': dc_id} }
+ }
+ }
+ }
+ result = self.client['SoftLayer_Account'].getNetworkVlans(mask=mask,filter=_filter)
+
+ # Vlans that are not-standard, part of a firewall or gateway, can't be ordered on.
+ print("ID, Vlan Number, Type, Router")
+ for vlan in result:
+ vlan_type = vlan['type']['keyName']
+ if vlan_type == 'GATEWAY':
+ vlan_type = 'GATEWAY (No ordering)'
+ elif vlan['dedicatedFirewallFlag'] == 1:
+ vlan_type = "%s/FIREWALL (No ordering)" % vlan_type
+ elif vlan['attachedNetworkGatewayFlag']:
+ vlan_type = "%s/GATEWAY MEMBER (No ordering)" % vlan_type
+
+ print("%s - VLAN: %s - Type: %s - %s " %
+ (vlan['id'],
+ vlan['vlanNumber'],
+ vlan_type,
+ vlan['primaryRouter']['hostname'])
+ )
+
+
+if __name__ == "__main__":
+ main = vyattaOrderer()
+ # 2255245 - VLAN: 946 - Type: STANDARD - bcr01a.sjc04
+ # 2255243 - VLAN: 913 - Type: STANDARD - fcr01a.sjc04
+ # main.orderVyatta('sjc04', 2255243, 2255245)
+ main.orderVyattaHA('sjc04', 2255243, 2255245)
+ We would love to hear it
+ Open an issue
+
An example without using a preset
+slcli order place --verify --billing monthly DUAL_E52600_V4_4_DRIVES DALLAS13 \
+ BANDWIDTH_500_GB \
+ HARD_DRIVE_1_00_TB_SATA_2 \
+ DISK_CONTROLLER_NONRAID \
+ MONITORING_HOST_PING \
+ NOTIFICATION_EMAIL_AND_TICKET \
+ OS_CENTOS_7_X_64_BIT \
+ 1_GBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS \
+ 1_IP_ADDRESS \
+ 1_IPV6_ADDRESS \
+ RAM_128_GB_DDR4_2133_ECC_REG \
+ REBOOT_KVM_OVER_IP \
+ AUTOMATED_NOTIFICATION \
+ INTEL_INTEL_XEON_E52690_V4_2_60 \
+ UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT \
+ NESSUS_VULNERABILITY_ASSESSMENT_REPORTING \
+ --extras '{"hardware": [{"hostname" : "testOrder1", "domain": "cgallo.com"}], "sshKeys" : [87634], "tags": "cgallo, test"}' \
+ --complex-type SoftLayer_Container_Product_Order_Hardware_Server
unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+unsignedLong
unsignedLong
+SoftLayer_Hardware_Attribute_UserData
+SoftLayer_Hardware_Attribute[]
diff --git a/reference/services/SoftLayer_Hardware_Router/index.xml b/reference/services/SoftLayer_Hardware_Router/index.xml index 859b3ccb96c..85af9bd00f3 100644 --- a/reference/services/SoftLayer_Hardware_Router/index.xml +++ b/reference/services/SoftLayer_Hardware_Router/index.xml @@ -1719,7 +1719,7 @@ Parameters Name Type Description Required Headers SoftLayer_Hardware_RoSoftLayer_Hardware_Attribute_UserData
+SoftLayer_Hardware_Attribute[]
diff --git a/reference/services/SoftLayer_Hardware_SecurityModule/index.xml b/reference/services/SoftLayer_Hardware_SecurityModule/index.xml index 3139aee935e..5034748cf85 100644 --- a/reference/services/SoftLayer_Hardware_SecurityModule/index.xml +++ b/reference/services/SoftLayer_Hardware_SecurityModule/index.xml @@ -2420,7 +2420,7 @@ Parameters Name Type Description Required Headers SoftLayer_Hardware_SeSoftLayer_Hardware_Attribute_UserData
+SoftLayer_Hardware_Attribute[]
diff --git a/reference/services/SoftLayer_Hardware_SecurityModule750/index.xml b/reference/services/SoftLayer_Hardware_SecurityModule750/index.xml index 7990a1a0ee5..0db58458f8f 100644 --- a/reference/services/SoftLayer_Hardware_SecurityModule750/index.xml +++ b/reference/services/SoftLayer_Hardware_SecurityModule750/index.xml @@ -2420,7 +2420,7 @@ Parameters Name Type Description Required Headers SoftLayer_Hardware_SeSoftLayer_Hardware_Attribute_UserData
+SoftLayer_Hardware_Attribute[]
diff --git a/reference/services/SoftLayer_Hardware_Server/index.xml b/reference/services/SoftLayer_Hardware_Server/index.xml index ef5be1a73c5..356902f0753 100644 --- a/reference/services/SoftLayer_Hardware_Server/index.xml +++ b/reference/services/SoftLayer_Hardware_Server/index.xml @@ -2443,7 +2443,7 @@ Parameters Name Type Description Required Headers SoftLayer_Hardware_SeThis method is deprecated! SoftLayer Community Forums no longer exist, therefore, any password verified will return false.
+This method is deprecated! SoftLayer Community Forums no longer exist, therefore, any password verified will return false. In the future, this method will be completely removed.
Determine if a string is the given user’s login password to the SoftLayer community forums.
@@ -216,13 +216,7 @@boolean
- -void
diff --git a/reference/services/SoftLayer_User_Customer/updateForumPassword/index.html b/reference/services/SoftLayer_User_Customer/updateForumPassword/index.html index 4517a57a2aa..04b0db42a01 100644 --- a/reference/services/SoftLayer_User_Customer/updateForumPassword/index.html +++ b/reference/services/SoftLayer_User_Customer/updateForumPassword/index.html @@ -181,7 +181,7 @@This method is deprecated! SoftLayer Community Forums no longer exist, therefore, this method will return false.
+This method is deprecated! SoftLayer Community Forums no longer exist, therefore, this method will return false. In the future, this method will be completely removed.
Update a user’s password on the SoftLayer community forums. As with portal passwords, user forum passwords must match the following restrictions. Forum passwords must… * …be over eight characters long. @@ -225,13 +225,7 @@
boolean
- -void
This method is deprecated! SoftLayer Community Forums no longer exist, therefore, any password verified will return false.
+This method is deprecated! SoftLayer Community Forums no longer exist, therefore, any password verified will return false. In the future, this method will be completely removed.
Determine if a string is the given user’s login password to the SoftLayer community forums.
@@ -216,13 +216,7 @@boolean
- -void
diff --git a/reference/services/SoftLayer_User_Customer_OpenIdConnect/updateForumPassword/index.html b/reference/services/SoftLayer_User_Customer_OpenIdConnect/updateForumPassword/index.html index 4592b3e14a9..696a9f11d7f 100644 --- a/reference/services/SoftLayer_User_Customer_OpenIdConnect/updateForumPassword/index.html +++ b/reference/services/SoftLayer_User_Customer_OpenIdConnect/updateForumPassword/index.html @@ -181,7 +181,7 @@This method is deprecated! SoftLayer Community Forums no longer exist, therefore, this method will return false.
+This method is deprecated! SoftLayer Community Forums no longer exist, therefore, this method will return false. In the future, this method will be completely removed.
Update a user’s password on the SoftLayer community forums. As with portal passwords, user forum passwords must match the following restrictions. Forum passwords must… * …be over eight characters long. @@ -225,13 +225,7 @@
boolean
- -void
SoftLayer_Notification_Occurrence_Events at SoftLayer are how we communicate maintenance, outages, and other disruptive events to customers. In the control portal, you can find these at https://control.softlayer.com/event/announcement
+ +SoftLayer_Notification_Occurrence_Event::getAllObjects()
+curl -u $SL_USER:$SL_APIKEY 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json
The output will look something like this, but will have every event that has ever been reported on your account. For brevity I have only included 1 Event
+[
+ {
+ "endDate": null,
+ "id": 2584,
+ "lastImpactedUserCount": 11232,
+ "modifyDate": "2016-06-13T08:27:20-06:00",
+ "recoveryTime": null,
+ "startDate": "2014-03-31T00:35:00-06:00",
+ "statusCode": {
+ "keyName": "COMPLETED",
+ "name": "Completed"
+ },
+ "subject": "IPv6 Sessions Down on FCR02.DAL05",
+ "summary": "At 31-Mar-2014 06:35 UTC the Network Operations Center was alerted that the IPv6 BGP session on frontend customer router (FCR) fcr02.dal05 had dropped. Network Engineers began investigating the issue and found a customer was sending a high rate of IPv6 packets destined to fcr02.dal05. Network Engineers mitigated the issue at 31-Mar-2014 07:16 UTC.",
+ "systemTicketId": 9266184
+ }
+]
To find all the open events, look for statusCode = ACTIVE
+ +statusCode = COMPLETED is also an option.
+https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?
+objectMask=mask[notificationOccurrenceEventType]
+resultLimit=0,10
+objectFilter={"statusCode":+{"keyName":+{"operation":+"ACTIVE"}}}'
curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?objectMask=mask%5BnotificationOccurrenceEventType%5D&resultLimit=0%2C10&objectFilter=%7B%22statusCode%22%3A+%7B%22keyName%22%3A+%7B%22operation%22%3A+%22ACTIVE%22%7D%7D%7D'
{'endDate': '2018-04-05T17:00:00-06:00',
+ 'id': 116425,
+ 'lastImpactedUserCount': 581,
+ 'modifyDate': '2018-04-05T07:35:20-06:00',
+ 'notificationOccurrenceEventType': {'keyName': 'PLANNED'},
+ 'recoveryTime': None,
+ 'startDate': '2018-04-05T04:00:00-06:00',
+ 'statusCode': {'keyName': 'ACTIVE', 'name': 'Active'},
+ 'subject': 'Scheduled Maintenance: WDC04 Critical Power Maintenance',
+ 'summary': 'Dear IBM Customer, \r\n'
+ '\r\n'
+ 'IBM Cloud in coordination with our vendors will be performing a '
+ 'Critical Power Maintenance at WDC04 starting on Thursday, April '
+ '5th, 2018. The window for this maintenance is 06:00am EST to '
+ '19:00pm EST.\r\n'
+ '\r\n'
+ 'We Do not expect any major impact to our servers or services '
+ 'during this maintenance. The only expected impact during this '
+ 'maintenance will be a loss of redundancy at the server level '
+ 'only for a short period of time as they work on the Secondary '
+ 'power source and a 5-10 minute loss of IPMI functionality during '
+ 'the transition to alternative power source at the start and end '
+ 'of the maintenace but will not be an extended period of time.\r\n'
+ '\r\n'
+ 'If additional preventative course of action is required to '
+ 'minimize service impact, further notification(s) will be '
+ 'provided. In the event of an unexpected impact, we will work '
+ 'with our Data Center Staff and on-site Engineers to take '
+ 'immediate action to bring critical services back on-line as '
+ 'quickly as possible. \r\n'
+ '\r\n'
+ '\r\n'
+ '***Scheduled Date(s): Thursday, April 5th, 2018 \r\n'
+ '***Scheduled Time(s): 06:00am EST to 19:00pm EST Please contact '
+ 'our support department should you have any questions or '
+ 'concerns.',
+ 'systemTicketId': 58076149},
Events can be PLANNED, UNPLANNED_INCIDENT, or ANNOUNCEMENT.
+ +Planned events are usually announced a few weeks in advanced, and cover things like router upgrades, VSI reboots, and other work that needs to be done to improve our products.
+ +This will get all the PLANNED and ACTIVE events going on.
+https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?
+objectMask=mask[notificationOccurrenceEventType]&
+objectFilter={
+ "notificationOccurrenceEventType":{"keyName":{"operation":+"PLANNED"}},
+ "statusCode":{"keyName":{"operation":"ACTIVE"}}}'
curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?objectMask=mask%5BnotificationOccurrenceEventType%5D&objectFilter=%7B%22notificationOccurrenceEventType%22%3A+%7B%22keyName%22%3A+%7B%22operation%22%3A+%22PLANNED%22%7D%7D%2C+%22statusCode%22%3A+%7B%22keyName%22%3A+%7B%22operation%22%3A+%22ACTIVE%22%7D%7D%7D'
Output:
+ {'endDate': '2017-08-19T19:00:00-06:00',
+ 'id': 81507,
+ 'lastImpactedUserCount': 284685,
+ 'modifyDate': '2017-08-19T13:25:50-06:00',
+ 'notificationOccurrenceEventType': {'keyName': 'PLANNED'},
+ 'recoveryTime': None,
+ 'startDate': '2017-08-19T13:00:00-06:00',
+ 'statusCode': {'keyName': 'ACTIVE', 'name': 'Active'},
+ 'subject': 'Emergency Planned IMS Maintenance',
+ 'summary': 'The IBM Cloud system engineers will be performing an emergency '
+ 'IMS application database system maintenance. During this '
+ 'maintenance we do not expect any IMS database or application '
+ 'system downtime. The purpose of the maintenance is to resolve '
+ 'IMS database system issues. When the maintenance tasks are '
+ 'completed, notifications will be sent out stating that IMS '
+ 'application database maintenance has been successfully '
+ 'completed.\r\n',
+ 'systemTicketId': 44279325}
Unplanned incidents are a whole variety of things that might impact services.
+ +This query will get all the UNPLANNED_INCIDENTS that were created AFTER 04/01/2018 01:00:00. https://softlayer.github.io/article/object-filters/ has more details on other date time operations you can use.
+https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?
+objectMask=mask[id,+startDate,+notificationOccurrenceEventType]&
+objectFilter={
+ "notificationOccurrenceEventType":
+ {"keyName":{"operation":"UNPLANNED_INCIDENT"}
+ }
+ "startDate":
+ {"operation":"greaterThanDate",
+ "options":[{"name":"date","value":["04/01/2018 01:00:00"]}]
+ }
+}
curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?objectMask=mask%5Bid%2C+startDate%2C+notificationOccurrenceEventType%5D&objectFilter=%7B%22notificationOccurrenceEventType%22%3A+%7B%22keyName%22%3A+%7B%22operation%22%3A+%22UNPLANNED_INCIDENT%22%7D%7D%2C+%22startDate%22%3A+%7B%22operation%22%3A+%22greaterThanDate%22%2C+%22options%22%3A+%5B%7B%22name%22%3A+%22date%22%2C+%22value%22%3A+%5B%2204%2F01%2F2018+01%3A00%3A00%22%5D%7D%5D%7D%7D'
Output
+{'endDate': '2018-04-02T23:41:00-06:00',
+ 'id': 116225,
+ 'lastImpactedUserCount': 7905,
+ 'modifyDate': '2018-04-03T11:04:32-06:00',
+ 'notificationOccurrenceEventType': {'keyName': 'UNPLANNED_INCIDENT'},
+ 'recoveryTime': None,
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'statusCode': {'keyName': 'ACTIVE', 'name': 'Active'},
+ 'subject': 'Private network degradation in DCs in Dallas region',
+ 'summary': 'At 03-Apr-2018 5:03 UTC the Network Operation Center was alerted '
+ 'to communication failures for the backend private networks in '
+ 'the Dallas Region. Network Engineers are investigating at this '
+ 'time. We will provide more detail as it becomes available.',
+ 'systemTicketId': 58021829}
Announcements are the ‘everything else’ category. Not usually disruptive, will usually be things like end of life announcements.
+ +This time I’ve changed the objectMask to include the lastUpdate and restrict other local fields to limit the amount of information we get back to fields I care about at the moment.
+https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?
+objectMask=mask[
+ id, startDate, subject, lastUpdate ,notificationOccurrenceEventType
+]&
+objectFilter=
+ {"notificationOccurrenceEventType":
+ {"keyName":{"operation":"ANNOUNCEMENT"}}
+ }'
curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2ClastUpdate%2CnotificationOccurrenceEventType%5D&objectFilter=%7B%22notificationOccurrenceEventType%22%3A+%7B%22keyName%22%3A+%7B%22operation%22%3A+%22ANNOUNCEMENT%22%7D%7D%7D'
Output:
+ 'id': 106105,
+ 'lastUpdate': {'contents': 'IBM Cloud engineers have received patches from '
+ 'Red Hat that address the Meltdown and Spectre '
+ 'security vulnerabilities.\r\n'
+ '\r\n'
+ 'New image only available for Red Hat Enterprise '
+ 'Linux 7.x at this time. \r\n'
+ '\r\n'
+ 'As always - before applying new images, IBM '
+ 'Cloud recommends testing to ensure a smooth '
+ 'transition for your environment.\r\n'
+ '\r\n'
+ '\r\n'
+ 'IBM Cloud',
+ 'createDate': '2018-01-17T13:44:51-06:00',
+ 'endDate': None,
+ 'startDate': '2018-01-17T13:44:51-06:00'},
+ 'notificationOccurrenceEventType': {'keyName': 'ANNOUNCEMENT'},
+ 'startDate': None,
+ 'subject': 'New Red Hat Enterprise Linux 7 Images Available'
Now that we know how to deal with getting a list of all events, lets dive into a specific event.
+ +The most recent Active event I have is going to be this one.
+ 'endDate': '2018-04-02T23:41:00-06:00',
+ 'id': 116225,
+ 'lastImpactedUserCount': 7905,
+ 'modifyDate': '2018-04-03T11:04:32-06:00',
+ 'notificationOccurrenceEventType': {'keyName': 'UNPLANNED_INCIDENT'},
+ 'recoveryTime': None,
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'statusCode': {'keyName': 'ACTIVE', 'name': 'Active'},
+ 'subject': 'Private network degradation in DCs in Dallas region',
To see what machines on our account are effected by this event, we need to tap into the impactedResources relational property. There is also impactedAccounts and impactedUsers that work the same way.
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/116225/getObject.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2CimpactedResources%5D'
Output:
+{'id': 116225,
+ 'impactedResources': [{'active': 1,
+ 'filterLabel': 'dal01',
+ 'hostname': 'testvpn.test.com',
+ 'notificationOccurrenceEventId': 116225,
+ 'privateIp': '10.17.223.157',
+ 'publicIp': '208.43.49.207',
+ 'resourceAccountId': 307608,
+ 'resourceName': 'testvpn.test.com',
+ 'resourceTableId': 218467,
+ 'resourceType': 'SERVER'},
+ {'active': 1,
+ 'filterLabel': 'dal01',
+ 'hostname': 'domain-master.lablayer.info',
+ 'notificationOccurrenceEventId': 116225,
+ 'privateIp': '10.37.82.159',
+ 'publicIp': '173.193.23.40',
+ 'resourceAccountId': 307608,
+ 'resourceName': 'domain-master.lablayer.info',
+ 'resourceTableId': 662657,
+ 'resourceType': 'SERVER'}],
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'subject': 'Private network degradation in DCs in Dallas region'}
If the resource is a storage volume, the output would look more like this
+{'id': 115025,
+ 'impactedResources': [{'active': 1,
+ 'filterLabel': 'Storage Type 02 File Cluster '
+ 'stff-syd0101',
+ 'hostname': 'SL02SV307608_1',
+ 'notificationOccurrenceEventId': 115025,
+ 'privateIp': 'fsf-syd0101a-fz.service.softlayer.com',
+ 'resourceAccountId': 307608,
+ 'resourceName': 'SL02SV307608_1',
+ 'resourceTableId': 39134586,
+ 'resourceType': 'STORAGE_NAS'}],
+ 'startDate': '2018-04-02T05:20:00-06:00',
+ 'subject': 'PLANNED MAINTENANCE: Performance/Endurance File Storage Services '
+ 'in SYD01'}
Over the course of an event, SoftLayer employees working to resolve the event will update it with progress if needed. To get that information, tap into the updates relational property
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/116225/getObject.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2Cupdates%5D'
Output:
+{'id': 116225,
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'subject': 'Private network degradation in DCs in Dallas region',
+ 'updates': [{'contents': 'At 06:48 UTC network engineers performed a '
+ 'supervisor failover on mbr01.dal01 which restored '
+ 'backend connectivity for affected hosts. A reboot '
+ 'and disk check may be required for virtual hosts '
+ "which use SAN. If you're still experiencing issues "
+ 'please contact support via phone, chat or ticket '
+ 'and reference event ID #58021829.',
+ 'createDate': '2018-04-03T01:45:20-06:00',
+ 'endDate': None,
+ 'startDate': '2018-04-03T01:44:00-06:00'},
+ {'contents': 'As of 03-April-2018 06:45 UTC network engineers are '
+ 'still investigating and working to restore '
+ 'connectivity as soon as possible.',
+ 'createDate': '2018-04-03T00:50:08-06:00',
+ 'endDate': None,
+ 'startDate': '2018-04-03T00:49:00-06:00'},
+ {'contents': 'At 03-Apr-2018 5:03 UTC the Network Operation '
+ 'Center was alerted to communication failures for '
+ 'the backend private networks in the Dallas Region. '
+ 'Network Engineers are investigating at this time. '
+ 'We will provide more detail as it becomes '
+ 'available.',
+ 'createDate': '2018-04-02T23:36:57-06:00',
+ 'endDate': None,
+ 'startDate': '2018-04-02T23:36:57-06:00'}]}
To Acknowledge events (this just makes them not pop-up in the control portal) use the acknowledgeNotification method
+ +Use the acknowledgeFlag to determine if an incident is in an acknowledged state or not.
+ +List all unacknowledged events
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/getAllObjects.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2CnotificationOccurrenceEventType%2CacknowledgedFlag%5D&objectFilter=%7B%22acknowledgedFlag%22%3A+%7B%22operation%22%3A+0%7D%7D'
Get the event, notice its unacknowledged
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/116225/getObject.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2CnotificationOccurrenceEventType%2CacknowledgedFlag%5D'
Acknowledge an event
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/116225/acknowledgeNotification.json'
Get the event, notice its acknowledged
+curl -u $SL_USER:$SL_APIKEY -X GET -H "Accept: */*" -H "Accept-Encoding: gzip, deflate, compress" 'https://api.softlayer.com/rest/v3.1/SoftLayer_Notification_Occurrence_Event/116225/getObject.json?objectMask=mask%5Bid%2CstartDate%2Csubject%2CnotificationOccurrenceEventType%2CacknowledgedFlag%5D'
Output:
+{'acknowledgedFlag': False,
+ 'id': 116225,
+ 'notificationOccurrenceEventType': {'keyName': 'UNPLANNED_INCIDENT'},
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'subject': 'Private network degradation in DCs in Dallas region'}
+True
+{'acknowledgedFlag': True,
+ 'id': 116225,
+ 'notificationOccurrenceEventType': {'keyName': 'UNPLANNED_INCIDENT'},
+ 'startDate': '2018-04-02T23:34:00-06:00',
+ 'subject': 'Private network degradation in DCs in Dallas region'}
+ We would love to hear it
+ Open an issue
+
vlans