Skip to content

Commit 4e5d577

Browse files
fix: CIS - multiple service update
fix: CIS - multiple service update
2 parents 7115680 + a70e6c3 commit 4e5d577

9 files changed

+326
-57
lines changed

cis.env.enc

0 Bytes
Binary file not shown.

ibm_cloud_networking_services/global_load_balancer_monitor_v1.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def create_load_balancer_monitor(self,
132132
follow_redirects: bool = None,
133133
expected_body: str = None,
134134
allow_insecure: bool = None,
135+
header: dict = None,
135136
**kwargs
136137
) -> DetailedResponse:
137138
"""
@@ -151,6 +152,7 @@ def create_load_balancer_monitor(self,
151152
:param bool follow_redirects: (optional) follow redirects.
152153
:param str expected_body: (optional) expected body.
153154
:param bool allow_insecure: (optional) allow insecure.
155+
:param dict header: (optional) header.
154156
:param dict headers: A `dict` containing the request headers
155157
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
156158
:rtype: DetailedResponse with `dict` result representing a `MonitorResp` object
@@ -174,7 +176,8 @@ def create_load_balancer_monitor(self,
174176
'interval': interval,
175177
'follow_redirects': follow_redirects,
176178
'expected_body': expected_body,
177-
'allow_insecure': allow_insecure
179+
'allow_insecure': allow_insecure,
180+
'header': header
178181
}
179182
data = {k: v for (k, v) in data.items() if v is not None}
180183
data = json.dumps(data)
@@ -209,6 +212,7 @@ def edit_load_balancer_monitor(self,
209212
follow_redirects: bool = None,
210213
expected_body: str = None,
211214
allow_insecure: bool = None,
215+
header: dict = None,
212216
**kwargs
213217
) -> DetailedResponse:
214218
"""
@@ -229,6 +233,7 @@ def edit_load_balancer_monitor(self,
229233
:param bool follow_redirects: (optional) follow redirects.
230234
:param str expected_body: (optional) expected body.
231235
:param bool allow_insecure: (optional) allow insecure.
236+
:param dict header: (optional) header.
232237
:param dict headers: A `dict` containing the request headers
233238
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
234239
:rtype: DetailedResponse with `dict` result representing a `MonitorResp` object
@@ -254,7 +259,8 @@ def edit_load_balancer_monitor(self,
254259
'interval': interval,
255260
'follow_redirects': follow_redirects,
256261
'expected_body': expected_body,
257-
'allow_insecure': allow_insecure
262+
'allow_insecure': allow_insecure,
263+
'header': header
258264
}
259265
data = {k: v for (k, v) in data.items() if v is not None}
260266
data = json.dumps(data)
@@ -609,6 +615,7 @@ class MonitorPack():
609615
:attr str expected_codes: expected codes.
610616
:attr bool follow_redirects: (optional) follow redirects.
611617
:attr bool allow_insecure: (optional) allow insecure.
618+
:attr dict header: (optional) header.
612619
"""
613620

614621
def __init__(self,
@@ -627,7 +634,8 @@ def __init__(self,
627634
retries: int = None,
628635
interval: int = None,
629636
follow_redirects: bool = None,
630-
allow_insecure: bool = None) -> None:
637+
allow_insecure: bool = None,
638+
header: dict = None) -> None:
631639
"""
632640
Initialize a MonitorPack object.
633641
@@ -646,6 +654,7 @@ def __init__(self,
646654
:param int interval: (optional) interval.
647655
:param bool follow_redirects: (optional) follow redirects.
648656
:param bool allow_insecure: (optional) allow insecure.
657+
:param dict header: (optional) header.
649658
"""
650659
self.id = id
651660
self.created_on = created_on
@@ -662,6 +671,7 @@ def __init__(self,
662671
self.expected_codes = expected_codes
663672
self.follow_redirects = follow_redirects
664673
self.allow_insecure = allow_insecure
674+
self.header = header
665675

666676
@classmethod
667677
def from_dict(cls, _dict: Dict) -> 'MonitorPack':
@@ -701,6 +711,8 @@ def from_dict(cls, _dict: Dict) -> 'MonitorPack':
701711
args['follow_redirects'] = _dict.get('follow_redirects')
702712
if 'allow_insecure' in _dict:
703713
args['allow_insecure'] = _dict.get('allow_insecure')
714+
if 'header' in _dict:
715+
args['header'] = _dict.get('header')
704716
return cls(**args)
705717

706718
@classmethod
@@ -741,6 +753,8 @@ def to_dict(self) -> Dict:
741753
_dict['follow_redirects'] = self.follow_redirects
742754
if hasattr(self, 'allow_insecure') and self.allow_insecure is not None:
743755
_dict['allow_insecure'] = self.allow_insecure
756+
if hasattr(self, 'header') and self.header is not None:
757+
_dict['header'] = self.header
744758
return _dict
745759

746760
def _to_dict(self):

ibm_cloud_networking_services/global_load_balancer_pools_v0.py

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,26 +398,38 @@ class LoadBalancerPoolPackOriginsItem():
398398
:attr str address: (optional) address.
399399
:attr bool enabled: (optional) enabled/disabled.
400400
:attr bool healthy: (optional) healthy.
401+
:attr float weight: (optional) weight.
402+
:attr str disabled_at: (optional) Pool origin disabled date.
403+
:attr str failure_reason: (optional) Reason for failure.
401404
"""
402405

403406
def __init__(self,
404407
*,
405408
name: str = None,
406409
address: str = None,
407410
enabled: bool = None,
408-
healthy: bool = None) -> None:
411+
healthy: bool = None,
412+
weight: float = None,
413+
disabled_at: str = None,
414+
failure_reason: str = None) -> None:
409415
"""
410416
Initialize a LoadBalancerPoolPackOriginsItem object.
411417
412418
:param str name: (optional) name.
413419
:param str address: (optional) address.
414420
:param bool enabled: (optional) enabled/disabled.
415421
:param bool healthy: (optional) healthy.
422+
:param float weight: (optional) weight.
423+
:param str disabled_at: (optional) Pool origin disabled date.
424+
:param str failure_reason: (optional) Reason for failure.
416425
"""
417426
self.name = name
418427
self.address = address
419428
self.enabled = enabled
420429
self.healthy = healthy
430+
self.weight = weight
431+
self.disabled_at = disabled_at
432+
self.failure_reason = failure_reason
421433

422434
@classmethod
423435
def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPackOriginsItem':
@@ -431,6 +443,12 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPackOriginsItem':
431443
args['enabled'] = _dict.get('enabled')
432444
if 'healthy' in _dict:
433445
args['healthy'] = _dict.get('healthy')
446+
if 'weight' in _dict:
447+
args['weight'] = _dict.get('weight')
448+
if 'disabled_at' in _dict:
449+
args['disabled_at'] = _dict.get('disabled_at')
450+
if 'failure_reason' in _dict:
451+
args['failure_reason'] = _dict.get('failure_reason')
434452
return cls(**args)
435453

436454
@classmethod
@@ -449,6 +467,12 @@ def to_dict(self) -> Dict:
449467
_dict['enabled'] = self.enabled
450468
if hasattr(self, 'healthy') and self.healthy is not None:
451469
_dict['healthy'] = self.healthy
470+
if hasattr(self, 'weight') and self.weight is not None:
471+
_dict['weight'] = self.weight
472+
if hasattr(self, 'disabled_at') and self.disabled_at is not None:
473+
_dict['disabled_at'] = self.disabled_at
474+
if hasattr(self, 'failure_reason') and self.failure_reason is not None:
475+
_dict['failure_reason'] = self.failure_reason
452476
return _dict
453477

454478
def _to_dict(self):
@@ -476,23 +500,27 @@ class LoadBalancerPoolReqOriginsItem():
476500
:attr str name: (optional) name.
477501
:attr str address: (optional) address.
478502
:attr bool enabled: (optional) enabled/disabled.
503+
:attr float weight: (optional) weight.
479504
"""
480505

481506
def __init__(self,
482507
*,
483508
name: str = None,
484509
address: str = None,
485-
enabled: bool = None) -> None:
510+
enabled: bool = None,
511+
weight: float = None) -> None:
486512
"""
487513
Initialize a LoadBalancerPoolReqOriginsItem object.
488514
489515
:param str name: (optional) name.
490516
:param str address: (optional) address.
491517
:param bool enabled: (optional) enabled/disabled.
518+
:param float weight: (optional) weight.
492519
"""
493520
self.name = name
494521
self.address = address
495522
self.enabled = enabled
523+
self.weight = weight
496524

497525
@classmethod
498526
def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReqOriginsItem':
@@ -504,6 +532,8 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReqOriginsItem':
504532
args['address'] = _dict.get('address')
505533
if 'enabled' in _dict:
506534
args['enabled'] = _dict.get('enabled')
535+
if 'weight' in _dict:
536+
args['weight'] = _dict.get('weight')
507537
return cls(**args)
508538

509539
@classmethod
@@ -520,6 +550,8 @@ def to_dict(self) -> Dict:
520550
_dict['address'] = self.address
521551
if hasattr(self, 'enabled') and self.enabled is not None:
522552
_dict['enabled'] = self.enabled
553+
if hasattr(self, 'weight') and self.weight is not None:
554+
_dict['weight'] = self.weight
523555
return _dict
524556

525557
def _to_dict(self):
@@ -734,6 +766,8 @@ class LoadBalancerPoolPack():
734766
:attr bool enabled: (optional) enabled/disabled.
735767
:attr bool healthy: (optional) healthy.
736768
:attr str monitor: (optional) monitor.
769+
:attr int minimum_origins: (optional) Minimum origin count.
770+
:attr List[str] check_regions: (optional) regions check.
737771
:attr List[LoadBalancerPoolPackOriginsItem] origins: original.
738772
:attr str notification_email: (optional) notification email.
739773
"""
@@ -749,6 +783,8 @@ def __init__(self,
749783
enabled: bool = None,
750784
healthy: bool = None,
751785
monitor: str = None,
786+
minimum_origins: int = None,
787+
check_regions: List[str] = None,
752788
notification_email: str = None) -> None:
753789
"""
754790
Initialize a LoadBalancerPoolPack object.
@@ -762,6 +798,8 @@ def __init__(self,
762798
:param bool enabled: (optional) enabled/disabled.
763799
:param bool healthy: (optional) healthy.
764800
:param str monitor: (optional) monitor.
801+
:param int minimum_origins: (optional) Minimum origin count.
802+
:param List[str] check_regions: (optional) regions check.
765803
:param str notification_email: (optional) notification email.
766804
"""
767805
self.id = id
@@ -772,6 +810,8 @@ def __init__(self,
772810
self.enabled = enabled
773811
self.healthy = healthy
774812
self.monitor = monitor
813+
self.minimum_origins = minimum_origins
814+
self.check_regions = check_regions
775815
self.origins = origins
776816
self.notification_email = notification_email
777817

@@ -797,6 +837,10 @@ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPack':
797837
args['healthy'] = _dict.get('healthy')
798838
if 'monitor' in _dict:
799839
args['monitor'] = _dict.get('monitor')
840+
if 'minimum_origins' in _dict:
841+
args['minimum_origins'] = _dict.get('minimum_origins')
842+
if 'check_regions' in _dict:
843+
args['check_regions'] = _dict.get('check_regions')
800844
if 'origins' in _dict:
801845
args['origins'] = [LoadBalancerPoolPackOriginsItem.from_dict(x) for x in _dict.get('origins')]
802846
else:
@@ -829,6 +873,10 @@ def to_dict(self) -> Dict:
829873
_dict['healthy'] = self.healthy
830874
if hasattr(self, 'monitor') and self.monitor is not None:
831875
_dict['monitor'] = self.monitor
876+
if hasattr(self, 'minimum_origins') and self.minimum_origins is not None:
877+
_dict['minimum_origins'] = self.minimum_origins
878+
if hasattr(self, 'check_regions') and self.check_regions is not None:
879+
_dict['check_regions'] = self.check_regions
832880
if hasattr(self, 'origins') and self.origins is not None:
833881
_dict['origins'] = [x.to_dict() for x in self.origins]
834882
if hasattr(self, 'notification_email') and self.notification_email is not None:

0 commit comments

Comments
 (0)