agilicus 1.261.0__py3-none-any.whl → 1.261.2__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -77,7 +77,7 @@ class ApiClient(object):
77
77
  self.default_headers[header_name] = header_value
78
78
  self.cookie = cookie
79
79
  # Set default User-Agent.
80
- self.user_agent = 'OpenAPI-Generator/1.261.0/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.261.2/python'
81
81
 
82
82
  def __enter__(self):
83
83
  return self
@@ -387,7 +387,7 @@ class Configuration(object):
387
387
  "OS: {env}\n"\
388
388
  "Python Version: {pyversion}\n"\
389
389
  "Version of the API: 2024.06.21\n"\
390
- "SDK Package Version: 1.261.0".\
390
+ "SDK Package Version: 1.261.2".\
391
391
  format(env=sys.platform, pyversion=sys.version)
392
392
 
393
393
  def get_host_settings(self):
@@ -4,7 +4,7 @@ Agilicus is API-first. Modern software is controlled by other software, is open,
4
4
  The `agilicus_api` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5
5
 
6
6
  - API version: 2024.06.21
7
- - Package version: 1.261.0
7
+ - Package version: 1.261.2
8
8
  - Build package: org.openapitools.codegen.languages.PythonClientCodegen
9
9
  For more information, please visit [https://www.agilicus.com/api](https://www.agilicus.com/api)
10
10
 
agilicus/connectors.py CHANGED
@@ -49,17 +49,44 @@ def _filter_version(connector, not_version=None):
49
49
  return filter_out
50
50
 
51
51
 
52
- def do_filter(ctx, no_down, connectors, not_version=None, sort_by=None, **kwargs):
52
+ def _filter_os_version(connector, os_version_regex):
53
+ if not os_version_regex:
54
+ return False
55
+
56
+ filter_out = True
57
+ for instance in connector["status"].get("instances", []):
58
+ try:
59
+ if os_version_regex.match(_get_os_version(instance, "")):
60
+ filter_out = False
61
+ except Exception:
62
+ pass
63
+ return filter_out
64
+
65
+
66
+ def do_filter(
67
+ ctx,
68
+ no_down,
69
+ connectors,
70
+ not_version=None,
71
+ sort_by=None,
72
+ filter_os_version=None,
73
+ **kwargs,
74
+ ):
53
75
  if sort_by:
54
76
  connectors = sorted(connectors, key=lambda k: (operator.attrgetter(*sort_by)(k)))
55
77
 
56
- if no_down is False:
57
- return connectors
78
+ os_version_regex = None
79
+ if filter_os_version:
80
+ os_version_regex = re.compile(filter_os_version)
58
81
  filtered_connectors = []
59
82
  for connector in connectors:
60
83
  if _filter_version(connector, not_version):
61
84
  continue
62
- if connector["status"]["operational_status"]["status"] != "down":
85
+ if _filter_os_version(connector, os_version_regex):
86
+ continue
87
+ if not no_down:
88
+ filtered_connectors.append(connector)
89
+ elif connector["status"]["operational_status"]["status"] != "down":
63
90
  filtered_connectors.append(connector)
64
91
  return filtered_connectors
65
92
 
@@ -71,6 +98,7 @@ def query(
71
98
  sort_by=None,
72
99
  page_at_id=None,
73
100
  page_size=500,
101
+ filter_os_version=None,
74
102
  **kwargs,
75
103
  ):
76
104
  token = context.get_token(ctx)
@@ -96,6 +124,7 @@ def query(
96
124
  query_results,
97
125
  not_version=not_version,
98
126
  sort_by=sort_by,
127
+ filter_os_version=filter_os_version,
99
128
  **kwargs,
100
129
  )
101
130
 
@@ -170,6 +199,7 @@ def _instances_table():
170
199
  status_column("instance_number"),
171
200
  column("status", newname="status", getter=_get_oper_status, optional=True),
172
201
  column("hostname", getter=_get_hostname, optional=True),
202
+ column("os_version", getter=_get_os_version, optional=True),
173
203
  column("version", getter=_get_version, optional=True),
174
204
  column(
175
205
  "stats",
agilicus/main.py CHANGED
@@ -5189,6 +5189,7 @@ def show_api_key_introspection(ctx, email, api_key, include_suborgs=False, **kwa
5189
5189
  @click.option("--no-down", is_flag=True, type=bool, default=False)
5190
5190
  @click.option("--page-at-id", default=None)
5191
5191
  @click.option("--page-size", default=500, type=int)
5192
+ @click.option("--filter-os-version", default=None)
5192
5193
  @click.option(
5193
5194
  "--sort-by",
5194
5195
  type=click.Choice(["metadata.created", "status.operational_status.status"]),
agilicus/output/table.py CHANGED
@@ -221,12 +221,41 @@ def _dump_json(ctx, to_dump):
221
221
  return convert_to_json(ctx, to_dump_as_dict)
222
222
 
223
223
 
224
+ def get_table_style(ctx):
225
+ table_style_str = context.get_value(ctx, "output_format")
226
+ table_style = None
227
+ if table_style_str and table_style_str != "console":
228
+ from prettytable import (
229
+ DEFAULT,
230
+ MARKDOWN,
231
+ PLAIN_COLUMNS,
232
+ MSWORD_FRIENDLY,
233
+ )
234
+
235
+ if table_style_str == "default":
236
+ table_style = DEFAULT
237
+ elif table_style_str == "markdown":
238
+ table_style = MARKDOWN
239
+ elif table_style_str == "plain":
240
+ table_style = PLAIN_COLUMNS
241
+ elif table_style_str == "msword":
242
+ table_style = MSWORD_FRIENDLY
243
+ else:
244
+ raise Exception(f"invalid table style {table_style_str}")
245
+ return table_style
246
+
247
+
224
248
  def format_table(
225
249
  ctx, records, columns, getter=short_circuit_attrgetter, row_filter=None
226
250
  ):
227
251
  if context.output_json(ctx):
228
252
  return _dump_json(ctx, records)
229
253
  table = PrettyTable([column.out_name for column in columns])
254
+
255
+ table_style = get_table_style(ctx)
256
+ if table_style:
257
+ table.set_style(table_style)
258
+
230
259
  if not records:
231
260
  return table
232
261
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.261.0
3
+ Version: 1.261.2
4
4
  Summary: Agilicus SDK
5
5
  Home-page: https://www.agilicus.com/
6
6
  License: MIT
@@ -71,9 +71,9 @@ agilicus/agilicus_api/api/users_api.py,sha256=xhcIheRgjfMpQ3RbekgnOp3ODUUm6deY1H
71
71
  agilicus/agilicus_api/api/users_api_mock.py,sha256=wA_xiqL3Pz3KjljKlsmf5NveLZS1FpbaKJHBp7QvarY,15411
72
72
  agilicus/agilicus_api/api/whoami_api.py,sha256=c95A5Rfll7idVIb09yTzUjqAVDpyVlRugUjprI5JBbo,7941
73
73
  agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
74
- agilicus/agilicus_api/api_client.py,sha256=ENFmNXGSJobDqAVsfDDikSxHyW0DF8cfPbudHpxmBkk,38845
74
+ agilicus/agilicus_api/api_client.py,sha256=z1MwieEt3Koda-vktrLnSGZDBPHvYw335UkGGQKqBPA,38845
75
75
  agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
76
- agilicus/agilicus_api/configuration.py,sha256=tyt3WRMFNRvKjZNGnwvEkREO_nklyahMiWpGOrpOhqg,18447
76
+ agilicus/agilicus_api/configuration.py,sha256=8s0RODgWPdGq7mb5oo6xjlgYElHWb5ePJ69EYOFKsgA,18447
77
77
  agilicus/agilicus_api/docs/APIKey.md,sha256=4cKuz4_l9HcEDnUrLwYbEnn9C2WoDayrjfrY1Ixgaf4,1747
78
78
  agilicus/agilicus_api/docs/APIKeyIntrospect.md,sha256=nJ-zkuFm3JMbWFDYYN_vYyQk1snGBtBvIxtCQxamhAU,1019
79
79
  agilicus/agilicus_api/docs/APIKeyIntrospectAuthorizationInfo.md,sha256=7RApOOLjvWQs5sw2jb25g7i3Kta1BiEY-s8VRXfppH8,725
@@ -2508,7 +2508,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=H82JE5XkABLdxrdI
2508
2508
  agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=Avjjv9atO5hYlSmAJU1CzS7M0l-0bPs6q4N5iXSoMcs,2832
2509
2509
  agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=6Iw5aUxT4lNJnOHK0ehotwh-niT9tuSCJIjRe1DKlRg,2846
2510
2510
  agilicus/agilicus_api/test/test_xss_settings.py,sha256=Stf0gqkOTrsfpeYF22QDlz85_Nny56SSwv5dpFZoNQU,2746
2511
- agilicus/agilicus_api_README.md,sha256=ARSi8m1rYg64uKu-_E8WkIa8xjQ0lHnlpmcs6pRkGgs,161008
2511
+ agilicus/agilicus_api_README.md,sha256=XInfUyrtvSQ_gF-GDXva4K-e3mj1MiiGtPl4Z6B_6Xo,161008
2512
2512
  agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
2513
2513
  agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
2514
2514
  agilicus/apps.py,sha256=uYNUNy5rCYjx90KnR_X_aESof9xzSuLYT5w8myN_VVE,52091
@@ -2520,7 +2520,7 @@ agilicus/certificate.py,sha256=iXC4iT3EGISyEezrvMgfic_lSCx2_JMSWevTLyGekR8,2739
2520
2520
  agilicus/challenges.py,sha256=Ig9888pHGMigBxI_e8m2T_HZiqbU6TxsBXT2EKZoIUY,6968
2521
2521
  agilicus/click_extension.py,sha256=uE57TjMqJxO9VFPBJO5-bTo9UrQiHPjIdI_iwKSaw6Q,224
2522
2522
  agilicus/client_secrets.json,sha256=eyPFVzziH48RuwWl66cfi0JE4jpmoec0Vo_F2TzYOeI,414
2523
- agilicus/connectors.py,sha256=RhnLMxQNNEgmkh9lCSQazL0uovt7lFuJJ1Eo1Wv9qqE,41229
2523
+ agilicus/connectors.py,sha256=4RLQEJ5s4QpKYZo6ZkVi2lWtRxToCBEtEh5wdbQ41nc,42016
2524
2524
  agilicus/context.py,sha256=tlmtUK5B1G-gBqfmljaPKPhLKur92jgAi5xC9SA7AVs,8128
2525
2525
  agilicus/create.py,sha256=ndMbOxQasyyUY7aW4U2TU8EKGcUla72xCjAwAwfTBVA,3270
2526
2526
  agilicus/credentials.py,sha256=F3yPAwoMcziP1OLmzeJ8jIz1W-91-HXu4zcymyMp1E4,4730
@@ -2558,7 +2558,7 @@ agilicus/labels/labels_main.py,sha256=ptJ34mf-iVaf8ezf3RWLcpeP2O0ntezS4tqJ0ks0el
2558
2558
  agilicus/launchers.py,sha256=r4nctnVtfP-Ho_HXEfAiMaMqJI0u7pbieHSS3Vd0QBE,11361
2559
2559
  agilicus/logs.py,sha256=tS8c_sdre1Dncrl59GVGQ0L3d2jtwlVjvIMl3SHJraY,766
2560
2560
  agilicus/lookups.py,sha256=MNmNsKpP7Fq_poLAnL9xo_iptFilKM9ziGLyIe8VKaw,669
2561
- agilicus/main.py,sha256=SCcayJjWCxeII63Alk-bWacHyr1VYORPfMpMQjvV8dE,269882
2561
+ agilicus/main.py,sha256=SvAbc6FXAKb38YdfQaBe9Az7qZnUcv_iPSdpPAqzvaU,269933
2562
2562
  agilicus/messages.py,sha256=Ydm-VhAsK23UnYdstv_HsOybBODfui5ubKc7F8R_dsw,5187
2563
2563
  agilicus/metrics.py,sha256=v4rwpvqDzeNG5GKNoZ7t34X5qUgly5IW2s-kXlS2vQM,2315
2564
2564
  agilicus/orgs.py,sha256=THcm1Me58PJ7Lai4LHptBitaymH0TXVXapFd7WZ3Mpg,14399
@@ -2566,7 +2566,7 @@ agilicus/output/__init__.py,sha256=UKZbHS4t15vazJuN46FN-3HHqkxMXU0p3df2VcsSLcY,1
2566
2566
  agilicus/output/column_builder.py,sha256=TWo4t8ygaTUv7qjD_moDroD1bKzzyTIao0FmLy5gs4o,4284
2567
2567
  agilicus/output/console.py,sha256=xBURxlA7H1kmQ7zIKuifs_aQJq1cvmCJ5CtQVSo3_Ns,400
2568
2568
  agilicus/output/json.py,sha256=-5bX7ud1hIxux4l3P-K2gJXrE2gdZ0Ua1hfUOCX9MUM,899
2569
- agilicus/output/table.py,sha256=slOLs30rybyZYFGNd_5bh4gVVz7tNafg3sey_20H1w8,7906
2569
+ agilicus/output/table.py,sha256=o5kYgAtIAhei4ex7YZrTK9tDVarJQHzF2Yj42TXt21g,8744
2570
2570
  agilicus/output/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2571
2571
  agilicus/output/tests/column_builder_test.py,sha256=fKP4V5sqXtmEIr-Q0gWVSFdBqCUtugZkP6G5gML_T7I,2130
2572
2572
  agilicus/pagination/pagination.py,sha256=hC7eLHxXKe4Iv7LdOZK3Dh8R_fKQIr9PPiWKJVyP4Nk,1672
@@ -2599,8 +2599,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
2599
2599
  agilicus/users.py,sha256=JT7TIiUOtSFXPOdxmIVFm7ygZTH1FjsIkD9j-vjLuMM,38474
2600
2600
  agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
2601
2601
  agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
2602
- agilicus-1.261.0.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2603
- agilicus-1.261.0.dist-info/METADATA,sha256=WfbLexPUatEevNmdnHQ6FnpQLgD-E8PHAPaV8M8aS00,3822
2604
- agilicus-1.261.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2605
- agilicus-1.261.0.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2606
- agilicus-1.261.0.dist-info/RECORD,,
2602
+ agilicus-1.261.2.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2603
+ agilicus-1.261.2.dist-info/METADATA,sha256=MbjA8D7PGpkDYIwfXPqNT7xXa9iJq6pmMO4DoM9Ybw0,3822
2604
+ agilicus-1.261.2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
2605
+ agilicus-1.261.2.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2606
+ agilicus-1.261.2.dist-info/RECORD,,