Skip to content

Commit 3de19cb

Browse files
authored
Merge pull request #12 from dollierp/cis-vlans
[cis/network] Add cis vlan module
2 parents a821330 + 84b30c6 commit 3de19cb

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

ibmcloud_python_sdk/cis/network/__init__.py

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from ibmcloud_python_sdk.utils import softlayer as sl
2+
from ibmcloud_python_sdk.utils.common import resource_error
3+
4+
5+
class Vlan():
6+
7+
def __init__(self):
8+
self.client = sl.client()
9+
self.nm = sl.SoftLayer.NetworkManager(self.client)
10+
11+
def get_vlans(self):
12+
"""Retrieve vlan list
13+
14+
:return: List of vlans
15+
:rtype: dict
16+
"""
17+
try:
18+
vlan = {}
19+
vlan["vlans"] = self.nm.list_vlans()
20+
21+
return vlan
22+
23+
except sl.SoftLayer.SoftLayerAPIError as error:
24+
return resource_error(error.faultCode, error.faultString)

0 commit comments

Comments
 (0)