illumio-pylo 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ from .JsonPayloadTypes import LabelGroupObjectJsonStructure, LabelObjectCreation
12
12
  LabelDimensionObjectStructure, AuditLogApiReplyEventJsonStructure, WorkloadsGetQueryLabelFilterJsonStructure, \
13
13
  NetworkDeviceObjectJsonStructure, NetworkDeviceEndpointObjectJsonStructure, HrefReference, \
14
14
  WorkloadObjectCreateJsonStructure, WorkloadObjectMultiCreateJsonRequestPayload, \
15
- WorkloadBulkUpdateEntryJsonStructure, WorkloadBulkUpdateResponseEntry
15
+ WorkloadBulkUpdateEntryJsonStructure, WorkloadBulkUpdateResponseEntry, VenObjectJsonStructure
16
16
 
17
17
  try:
18
18
  import requests as requests
@@ -62,16 +62,16 @@ all_object_types: Dict[ObjectTypes, ObjectTypes] = {
62
62
  class APIConnector:
63
63
  """docstring for APIConnector."""
64
64
 
65
- def __init__(self, fqdn: str, port, apiuser: str, apikey: str, skip_ssl_cert_check=False, org_id=1, name='unnamed'):
65
+ def __init__(self, fqdn: str, port, api_user: str, api_key: str, skip_ssl_cert_check=False, org_id=1, name='unnamed'):
66
66
  self.name = name
67
67
  self.fqdn: str = fqdn
68
68
  if type(port) is int:
69
69
  port = str(port)
70
70
  self.port: int = port
71
- self._api_key: str = apikey
71
+ self._api_key: str = api_key
72
72
  self._decrypted_api_key: str = None
73
- self.api_user: str = apiuser
74
- self.orgID: int = org_id
73
+ self.api_user: str = api_user
74
+ self.org_id: int = org_id
75
75
  self.skipSSLCertCheck: bool = skip_ssl_cert_check
76
76
  self.version: Optional['pylo.SoftwareVersion'] = None
77
77
  self.version_string: str = "Not Defined"
@@ -148,7 +148,7 @@ class APIConnector:
148
148
  def _make_api_url(self, path: str = '', include_org_id=False) -> str:
149
149
  url = self._make_base_url('/api/v2')
150
150
  if include_org_id:
151
- url += '/orgs/' + str(self.orgID)
151
+ url += '/orgs/' + str(self.org_id)
152
152
  url += path
153
153
 
154
154
  return url
@@ -624,6 +624,35 @@ class APIConnector:
624
624
 
625
625
  return None
626
626
 
627
+ def objects_ven_get(self,
628
+ include_deleted=False,
629
+ filter_by_ip: str = None,
630
+ filter_by_label: Optional[WorkloadsGetQueryLabelFilterJsonStructure] = None,
631
+ filter_by_name: str = None,
632
+ max_results: int = None,
633
+ async_mode=True) -> List[VenObjectJsonStructure]:
634
+ path = '/vens'
635
+ data = {}
636
+
637
+ if include_deleted:
638
+ data['include_deleted'] = 'yes'
639
+
640
+ if filter_by_ip is not None:
641
+ data['ip_address'] = filter_by_ip
642
+
643
+ if filter_by_label is not None:
644
+ # filter_by_label must be converted to json text
645
+ data['labels'] = json.dumps(filter_by_label)
646
+
647
+ if filter_by_name is not None:
648
+ data['name'] = filter_by_name
649
+
650
+ if max_results is not None:
651
+ data['max_results'] = max_results
652
+
653
+ return self.do_get_call(path=path, async_call=async_mode, params=data)
654
+
655
+
627
656
  def objects_workload_get(self,
628
657
  include_deleted=False,
629
658
  filter_by_ip: str = None,
@@ -14,7 +14,6 @@ except ImportError:
14
14
  paramiko = None
15
15
 
16
16
 
17
-
18
17
  class CredentialFileEntry(TypedDict):
19
18
  name: str
20
19
  fqdn: str
@@ -121,6 +121,35 @@ class WorkloadBulkUpdateResponseEntry(TypedDict):
121
121
  message: NotRequired[str]
122
122
 
123
123
 
124
+ class VenObjectWorkloadSummaryJsonStructure(TypedDict):
125
+ href: str
126
+ mode: str
127
+ online: bool
128
+
129
+
130
+ class VenObjectJsonStructure(TypedDict):
131
+ created_at: str
132
+ created_by: Optional[HrefReferenceWithName]
133
+ description: Optional[str]
134
+ hostname: Optional[str]
135
+ href: str
136
+ labels: List[HrefReference]
137
+ name: Optional[str]
138
+ interfaces: List[WorkloadInterfaceObjectJsonStructure]
139
+ updated_at: str
140
+ updated_by: Optional[HrefReferenceWithName]
141
+ last_heartbeat_at: Optional[str]
142
+ last_goodbye_at: Optional[str]
143
+ ven_type: Literal['server', 'endpoint', 'containerized-ven']
144
+ active_pce_fqdn: Optional[str]
145
+ target_pce_fqdn: Optional[str]
146
+ workloads: List[VenObjectWorkloadSummaryJsonStructure]
147
+ version: Optional[str]
148
+ os_id: Optional[str]
149
+ os_version: Optional[str]
150
+ os_platform: Optional[str]
151
+ uid: Optional[str]
152
+
124
153
 
125
154
  class RuleServiceReferenceObjectJsonStructure(TypedDict):
126
155
  href: str
@@ -71,7 +71,7 @@ class Organization:
71
71
  credentials = get_credentials_from_file(fqdn_or_profile_name, credential_file)
72
72
 
73
73
  connector = pylo.APIConnector(fqdn=credentials.fqdn, port=credentials.port,
74
- apiuser=credentials.api_user, apikey=credentials.api_key,
74
+ api_user=credentials.api_user, api_key=credentials.api_key,
75
75
  org_id=credentials.org_id,
76
76
  skip_ssl_cert_check=not credentials.verify_ssl, name=fqdn_or_profile_name)
77
77
 
illumio_pylo/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "0.3.2"
1
+ __version__ = "0.3.4"
2
2
 
3
3
  import os
4
4
  import sys
@@ -43,7 +43,7 @@ def get_organization(fqdn: str, port: int, api_user: str, api_key: str,
43
43
  """
44
44
  Load an organization from the API with parameters provided as arguments.
45
45
  """
46
- api = APIConnector(fqdn=fqdn, port=port, apiuser=api_user, apikey=api_key, org_id=organization_id,
46
+ api = APIConnector(fqdn=fqdn, port=port, api_user=api_user, api_key=api_key, org_id=organization_id,
47
47
  skip_ssl_cert_check=not verify_ssl)
48
48
  org = Organization(1)
49
49
  org.load_from_api(api, include_deleted_workloads=include_deleted_workloads,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: illumio_pylo
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: A set of tools and library for working with Illumio PCE
5
5
  Home-page: https://github.com/cpainchaud/pylo
6
6
  Author: Christophe Painchaud
@@ -7,7 +7,7 @@ illumio_pylo/LabelCommon.py,sha256=2HzljD2xJSBjf4Ywxk8JpBQQfbiZILCMV_Mj_EATIGk,1
7
7
  illumio_pylo/LabelGroup.py,sha256=bVXvONHwR44GkF-9S19Fs2cnc4g8IW42VjyKi7QXmvQ,2624
8
8
  illumio_pylo/LabelStore.py,sha256=_feA5HdrfnOgcWStBToesu1S2ymHQKEKEG2Ygcadh9g,19809
9
9
  illumio_pylo/LabeledObject.py,sha256=zXIFcHtuvgxhu93htxiWtHoJ_mMWfSSdOBRNlEiXej0,1991
10
- illumio_pylo/Organization.py,sha256=MeESA6HuU0HzzkIKbj1NW_wzkarq30ptsCiffD1lm2M,12379
10
+ illumio_pylo/Organization.py,sha256=_C6mLVdau7oVXrkQYLun-o53wJu5ajyzBojRjZmHeNo,12381
11
11
  illumio_pylo/Query.py,sha256=lgLjst41ma3HMVkngvTjL7zSLjh80RoXYL5vS3PWO7Q,13330
12
12
  illumio_pylo/ReferenceTracker.py,sha256=HyY0NwZwOdAzSXJrs6i6dhB_kgn1tidZL5LFLLkPuSM,1070
13
13
  illumio_pylo/Rule.py,sha256=jPU0hj8BDv2t-keL3NCK6NEd-kYSRkjwtzdo1xWiC5E,26352
@@ -21,14 +21,14 @@ illumio_pylo/VirtualServiceStore.py,sha256=b6bcMixq0Vfv7WjQTQnFHGCv_Mld7sOfvGi4N
21
21
  illumio_pylo/Workload.py,sha256=OIrP2TVFpCjQdjMYPdHkZHcKRszZ2hPnj4uRhI6d8EI,19677
22
22
  illumio_pylo/WorkloadStore.py,sha256=08FKIk9fubsaHy_-m2a0Io5sO_V9jmTa40-L3vyemRc,10947
23
23
  illumio_pylo/WorkloadStoreSubClasses.py,sha256=tK7s-7s5wRf9SHv3T00EOzgv4gX8gPIM77KBubCzBuo,6092
24
- illumio_pylo/__init__.py,sha256=0cUO16-EHeOd6bZL4Aap5BngagWLcGsCZAnvhoVSxdg,4192
24
+ illumio_pylo/__init__.py,sha256=JoTsLNNOxwNCpwpjcVgvH_th_rbooSZAxRdJfqflZlc,4194
25
25
  illumio_pylo/tmp.py,sha256=7PIn11aYfoxed7tjG_I1iZmiacn4TxZPihs7qD7f4DI,3123
26
- illumio_pylo/API/APIConnector.py,sha256=PM-7sNPmBaZ8fLM5KGcLd7nXBha4Il6fFGAHntToSdk,59433
26
+ illumio_pylo/API/APIConnector.py,sha256=Iw8uMEAQKJhKa29lvAk8jp8bUMwvvujiKa3gy5xsFlM,60500
27
27
  illumio_pylo/API/AuditLog.py,sha256=p0mfjrE5S8qoJgA5LIP_XGFBP3iL86Nl6BQEmhMVrPA,1533
28
28
  illumio_pylo/API/ClusterHealth.py,sha256=GdMpVQrHUW4zLM-409GcPHM8H8b3LAppO37ZcUZyT_Q,5122
29
- illumio_pylo/API/CredentialsManager.py,sha256=vPqekauA0twbcpbWx8GcGFX4DQlh0y0SWAE9M4HKBsE,11031
29
+ illumio_pylo/API/CredentialsManager.py,sha256=gGx63cEm4tnf4xLrmP5LAlDuEGlRjfuvOqut3xUl8i8,11030
30
30
  illumio_pylo/API/Explorer.py,sha256=fFAIF-67_uuKgJOP0eZPPJrOGuYmFl33GK75AyMjgJU,47590
31
- illumio_pylo/API/JsonPayloadTypes.py,sha256=eUsK1ba8PLoV-VReRE6A3qar-N3xckXRZbY2ckSkmMk,7113
31
+ illumio_pylo/API/JsonPayloadTypes.py,sha256=9gql3-tn3cu1qmpOD_JcPCX5b594eOKDgVhTqHu6CsQ,7984
32
32
  illumio_pylo/API/RuleSearchQuery.py,sha256=O0-MsUXhwmywoO0G-GXnLq6kkVC9LgmxMZwqVKc_oJE,5325
33
33
  illumio_pylo/API/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  illumio_pylo/Helpers/__init__.py,sha256=6E2eTZe-4qfPKGjRRQNtYsPrBhJSAjbdvv_DpniV_rY,49
@@ -65,8 +65,8 @@ illumio_pylo/utilities/resources/iplists-import-example.xlsx,sha256=VW-7CRr8NA2V
65
65
  illumio_pylo/utilities/resources/workload-exporter-filter-example.csv,sha256=cn5IA8AGEPjvS-EsPXA_GJ-LFsdF9t_44rSzFTCmAzE,36
66
66
  illumio_pylo/utilities/resources/workloads-import-example.csv,sha256=DEOGVikFjxQpMFFI0l0jb3hrxEEeZCpTGkmWkz6GUcY,91
67
67
  illumio_pylo/utilities/resources/workloads-import-example.xlsx,sha256=U8Ac2BZidA6NlvBFAVPHqeY5zmg3rjmIAXp5b3b1P5w,17101
68
- illumio_pylo-0.3.2.dist-info/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
69
- illumio_pylo-0.3.2.dist-info/METADATA,sha256=TQ6C78x4N8G9pvl48e9MKRErO1CIjV17ETRUM1tN824,12224
70
- illumio_pylo-0.3.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
71
- illumio_pylo-0.3.2.dist-info/top_level.txt,sha256=c5cu_ZMuSuxjq48ih58Kc0Tr8-JdQtV8GrKJicvWNFE,13
72
- illumio_pylo-0.3.2.dist-info/RECORD,,
68
+ illumio_pylo-0.3.4.dist-info/LICENSE,sha256=WYmcYJG1QFgu1hfo7qrEkZ3Jhcz8NUWe6XUraZvlIFs,10172
69
+ illumio_pylo-0.3.4.dist-info/METADATA,sha256=74kLC2e4AteYoHGw7Zig8hzclfGSd82yckcJcw-opXM,12224
70
+ illumio_pylo-0.3.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
71
+ illumio_pylo-0.3.4.dist-info/top_level.txt,sha256=c5cu_ZMuSuxjq48ih58Kc0Tr8-JdQtV8GrKJicvWNFE,13
72
+ illumio_pylo-0.3.4.dist-info/RECORD,,