agilicus 1.261.5__py3-none-any.whl → 1.262.0__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.5/python'
80
+ self.user_agent = 'OpenAPI-Generator/1.262.0/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.07.23\n"\
390
- "SDK Package Version: 1.261.5".\
390
+ "SDK Package Version: 1.262.0".\
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.07.23
7
- - Package version: 1.261.5
7
+ - Package version: 1.262.0
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/main.py CHANGED
@@ -5991,6 +5991,26 @@ def show_resource(ctx, **kwargs):
5991
5991
  output_entry(ctx, resources.get_resource(ctx, **kwargs))
5992
5992
 
5993
5993
 
5994
+ @cli.command(name="list-resource-groups")
5995
+ @click.option("--org-id", default=None)
5996
+ @click.pass_context
5997
+ def list_resource_groups(ctx, **kwargs):
5998
+ results = resources.list_resource_groups(ctx, **kwargs)
5999
+ columns = make_columns(
6000
+ ctx,
6001
+ results,
6002
+ """
6003
+ - id
6004
+ - resource_type
6005
+ - org_id
6006
+ - resource_members:
6007
+ - id
6008
+ - resource_type
6009
+ """,
6010
+ )
6011
+ print(format_table(ctx, results, columns))
6012
+
6013
+
5994
6014
  @cli.command(name="update-resource")
5995
6015
  @click.argument("id")
5996
6016
  @click.option("--org-id", default=None)
@@ -214,6 +214,17 @@ def migrate_policy_rules(ctx, org_id=None, dump_dir=None, **kwargs):
214
214
  migrate_resource(ctx, res, dump_dir=dump_dir)
215
215
 
216
216
 
217
+ def fetch_resource_rules(ctx, org_id=None, dump_dir=None, **kwargs):
218
+ org_id = get_org_from_input_or_ctx(ctx, org_id=org_id)
219
+ kwargs = strip_none(kwargs)
220
+ if not kwargs.get("resource_id"):
221
+ print(" fetching all applications")
222
+ for res in query_resources(
223
+ ctx, resource_type="application", org_id=org_id, **kwargs
224
+ ):
225
+ fetch_resource(ctx, res, dump_dir=dump_dir)
226
+
227
+
217
228
  def migrate_resource(ctx, resource, dump_dir=None):
218
229
  print(f" migrating resource: {resource.spec.name}")
219
230
  resource.spec.config = resource.spec.config or ResourceConfig()
@@ -286,6 +297,19 @@ def migrate_resource(ctx, resource, dump_dir=None):
286
297
  return resp
287
298
 
288
299
 
300
+ def fetch_resource(ctx, resource, dump_dir=None):
301
+ print(f" fetching resource: {resource.spec.name}")
302
+ resource.spec.config = resource.spec.config or ResourceConfig()
303
+ resource.spec.config.rules_config = (
304
+ resource.spec.config.rules_config or RulesConfig()
305
+ )
306
+
307
+ if dump_dir:
308
+ _dump_resource_rules(resource, dump_dir)
309
+ else:
310
+ print(resource.spec.config.rules_config.to_dict())
311
+
312
+
289
313
  def _dump_resource_rules(resource, dump_dir):
290
314
  now = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S")
291
315
  file_name = f"{resource.spec.org_id}-{resource.spec.name}-{now}.json"
@@ -335,3 +359,17 @@ def replace_policy_template(ctx, instance_id, template_dict, **kwargs):
335
359
  return apiclient.policy_templates_api.replace_policy_template_instance(
336
360
  instance_id, policy_template_instance=template_as_instance
337
361
  )
362
+
363
+
364
+ def kick_policy_template(ctx, instance_id, org_id=None, **kwargs):
365
+ org_id = get_org_from_input_or_ctx(ctx, org_id=org_id)
366
+ token = context.get_token(ctx)
367
+ apiclient = context.get_apiclient(ctx, token)
368
+ existing = apiclient.policy_templates_api.get_policy_template_instance(
369
+ instance_id,
370
+ org_id=org_id,
371
+ )
372
+ return apiclient.policy_templates_api.replace_policy_template_instance(
373
+ instance_id,
374
+ policy_template_instance=existing,
375
+ )
@@ -84,6 +84,17 @@ def cli_command_replace_policy_template(ctx, template_json_file, **kwargs):
84
84
  )
85
85
 
86
86
 
87
+ @click.command(name="kick-policy-template")
88
+ @click.option("--instance-id", required=True, type=str)
89
+ @click.option("--org-id", type=str)
90
+ @click.pass_context
91
+ def cli_command_kick_policy_template(ctx, **kwargs):
92
+ output_entry(
93
+ ctx,
94
+ policies.kick_policy_template(ctx, **kwargs).to_dict(),
95
+ )
96
+
97
+
87
98
  @click.command(name="delete-policy-template")
88
99
  @click.option("--instance-id", default=None, required=True)
89
100
  @click.option("--org-id", default=None)
@@ -101,6 +112,15 @@ def cli_command_migrate_policy_rules(ctx, **kwargs):
101
112
  policies.migrate_policy_rules(ctx, **kwargs)
102
113
 
103
114
 
115
+ @click.command(name="fetch-resource-rules")
116
+ @click.option("--org-id", default=None)
117
+ @click.option("--resource-id", default=None)
118
+ @click.option("--dump-dir", default=None, help="A directory to cache rules")
119
+ @click.pass_context
120
+ def cli_command_fetch_resource_rules(ctx, **kwargs):
121
+ policies.fetch_resource_rules(ctx, **kwargs)
122
+
123
+
104
124
  all_funcs = [func for func in dir() if "cli_command_" in func]
105
125
 
106
126
 
agilicus/resources.py CHANGED
@@ -327,3 +327,19 @@ def format_combined_resource_rules_as_text(ctx, resource_rules):
327
327
  ]
328
328
 
329
329
  return format_table(ctx, resource_rules, columns)
330
+
331
+
332
+ def list_resource_groups(ctx, org_id=None, **kwargs):
333
+ org_id = get_org_from_input_or_ctx(ctx, org_id=org_id)
334
+ token = context.get_token(ctx)
335
+ apiclient = context.get_apiclient(ctx, token)
336
+
337
+ org_ids = []
338
+ if org_id:
339
+ org_ids.append(org_id)
340
+ query_results = apiclient.resources_api.list_resource_groups(
341
+ org_ids=org_ids, **strip_none(kwargs)
342
+ )
343
+ if query_results:
344
+ return query_results.resource_groups
345
+ return []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.261.5
3
+ Version: 1.262.0
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=zHhkazoqwhO_ouAnRRG01of1DQ5F5MFPOo
71
71
  agilicus/agilicus_api/api/users_api_mock.py,sha256=wA_xiqL3Pz3KjljKlsmf5NveLZS1FpbaKJHBp7QvarY,15411
72
72
  agilicus/agilicus_api/api/whoami_api.py,sha256=u_UnYUAOkf9LYzAEmK_rhFPSZfoK01XFV5SBCmNwhuE,7941
73
73
  agilicus/agilicus_api/api/whoami_api_mock.py,sha256=rlvZoWnMCqORMZBg7SOv6d3xp52kELdh6wXcCaIZ93w,346
74
- agilicus/agilicus_api/api_client.py,sha256=NylW7djGKB3hz28ApSnfVF9ZUbM4TqKMaacjLYDiv9M,38845
74
+ agilicus/agilicus_api/api_client.py,sha256=rKfbaU4ThjVnq8vy7eVDdespMNbigbT1TxGzpAVJNNQ,38845
75
75
  agilicus/agilicus_api/apis/__init__.py,sha256=aJZD7x-umdSni6ZBr4XxzpH8pwtU9hA5LlCDxcqa1Q8,2224
76
- agilicus/agilicus_api/configuration.py,sha256=Hc0Wl-prjfmjYHa6CYHZoMSd9pUowZEepk4Be41rHXY,18447
76
+ agilicus/agilicus_api/configuration.py,sha256=2z6aWCGuRlhljuJFMdrFybAL1sDYsnpVCUgA-SvlSX0,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
@@ -2514,7 +2514,7 @@ agilicus/agilicus_api/test/test_x509_root_certificate.py,sha256=DFvBcCsULrTq_saV
2514
2514
  agilicus/agilicus_api/test/test_x509_root_certificate_spec.py,sha256=CvxHUMEkXSsbvdB1qDpQs2FrIz91IuS4BNRND8EImY0,2832
2515
2515
  agilicus/agilicus_api/test/test_x509_root_certificate_status.py,sha256=q9iWY-9AIvZgOjEZAS5gfXqh2XuNPM5vYz2M0uRBYAU,2846
2516
2516
  agilicus/agilicus_api/test/test_xss_settings.py,sha256=trR8QQLSVTOCeHq-AMlUrloFebuPRoxTLTbZlErA3No,2746
2517
- agilicus/agilicus_api_README.md,sha256=qiMQfnyumPD1MtzqTz7LaZ20M5bfTcnQyKsK3ymPQs8,161318
2517
+ agilicus/agilicus_api_README.md,sha256=O8Qw3ebqgj1HV0FgiAmkM0O0DCf9g1oxf3nqXGRcC8I,161318
2518
2518
  agilicus/aliases.ini,sha256=MxqiVo2f2xdUDVF1YDkNW36AIqN8hrYjlTVfraEUZXY,455
2519
2519
  agilicus/amq.py,sha256=yxi-YTbJPVl10s78Hlr1dmrQR63iaSIoROGVILzFPmE,1775
2520
2520
  agilicus/apps.py,sha256=uYNUNy5rCYjx90KnR_X_aESof9xzSuLYT5w8myN_VVE,52091
@@ -2564,7 +2564,7 @@ agilicus/labels/labels_main.py,sha256=ptJ34mf-iVaf8ezf3RWLcpeP2O0ntezS4tqJ0ks0el
2564
2564
  agilicus/launchers.py,sha256=r4nctnVtfP-Ho_HXEfAiMaMqJI0u7pbieHSS3Vd0QBE,11361
2565
2565
  agilicus/logs.py,sha256=tS8c_sdre1Dncrl59GVGQ0L3d2jtwlVjvIMl3SHJraY,766
2566
2566
  agilicus/lookups.py,sha256=MNmNsKpP7Fq_poLAnL9xo_iptFilKM9ziGLyIe8VKaw,669
2567
- agilicus/main.py,sha256=WhIw44SlHC-bOxAv58jAJIxTWtcjsit7_S9EvB3XmcE,269943
2567
+ agilicus/main.py,sha256=7G7FxeeaZhehewN8R9Lx6xYFHCeWmUKslktx0gt5d2Q,270419
2568
2568
  agilicus/messages.py,sha256=Ydm-VhAsK23UnYdstv_HsOybBODfui5ubKc7F8R_dsw,5187
2569
2569
  agilicus/metrics.py,sha256=v4rwpvqDzeNG5GKNoZ7t34X5qUgly5IW2s-kXlS2vQM,2315
2570
2570
  agilicus/orgs.py,sha256=THcm1Me58PJ7Lai4LHptBitaymH0TXVXapFd7WZ3Mpg,14399
@@ -2578,8 +2578,8 @@ agilicus/output/tests/column_builder_test.py,sha256=fKP4V5sqXtmEIr-Q0gWVSFdBqCUt
2578
2578
  agilicus/pagination/pagination.py,sha256=hC7eLHxXKe4Iv7LdOZK3Dh8R_fKQIr9PPiWKJVyP4Nk,1672
2579
2579
  agilicus/patches.py,sha256=qTqLOgCAcFZPcPOkgfqMnK9bnqTXMvj_0ERsjRFcZug,1384
2580
2580
  agilicus/permissions.py,sha256=uB65yuDFICp1N10m0cdUjgizx9MQzAbLbAsBSTw1Rcc,2117
2581
- agilicus/policy/policies.py,sha256=30lo6JwfXvxTYdBFLoQoOjFGvazx0kto5AgfVWpyP2g,10134
2582
- agilicus/policy/policy_main.py,sha256=gbCFCDzCMa9M1tpkquY6fZWsjcdglRBRRLcaYKiAi4c,3931
2581
+ agilicus/policy/policies.py,sha256=eAy1iRlYKvkuc-10ssw_iuchY-I24LvtHiruvyzo5Pg,11440
2582
+ agilicus/policy/policy_main.py,sha256=W91CxqQP1ye9UjsiMqgZNeULMvrzMB5TiPJZW3hogPM,4573
2583
2583
  agilicus/policy/templates.py,sha256=EUvAhOhSjDuLAe2UKIFEzBp5pNpOT5y1r7uyV_GG6uI,5638
2584
2584
  agilicus/policy_config/policy_config.py,sha256=s1GwbBI5wuLINcViTKE8NdfcntLEegwpUEi7pqmdKkY,627
2585
2585
  agilicus/policy_config/policy_config_main.py,sha256=ReiOziCvPShjunCt3ohrEMGq0IaP0eNyIXEvEg_WD1M,788
@@ -2588,7 +2588,7 @@ agilicus/products/products.py,sha256=he27jN3MUyXBdTdV2HRyvUYb0zD3W1TGsuC7NHLKngQ
2588
2588
  agilicus/products/products_main.py,sha256=saa2-e5oeHW6D5AWPcld99KwgQ9nBY3hoW8Jz_5nfMQ,3421
2589
2589
  agilicus/regions.py,sha256=21SzUJ9_hC8DiWLSLJ-vtSb1tWLhlcPXH9JhmXD_ypU,3343
2590
2590
  agilicus/resource_helpers.py,sha256=fyfqAxjfnIth1KlHNALlLtYYXIZzlWEJmSZNLdj2JV0,380
2591
- agilicus/resources.py,sha256=SkLkXsX3IOvuAcbQAEMPK0tV3BLfgl1MJEF2eoK498U,10455
2591
+ agilicus/resources.py,sha256=mtgCjZrEd-oHxgYA-TjbeHX3I8kT1R8DFzNBNAv9EG0,10918
2592
2592
  agilicus/response.py,sha256=tI2-dAJwhBuuDplSsouuMmCmKHSwR_Mx71af8tgsuYo,468
2593
2593
  agilicus/rules/rules.py,sha256=ixfMro-l30Pt1r_wyypWL8vhSWccdCoRv8mPJynhR2o,24991
2594
2594
  agilicus/rules/rules_main.py,sha256=kQ0g86Xjp5PXERb7AlHWZha4wZGV7pEYGWEIXggH9Kg,13639
@@ -2605,8 +2605,8 @@ agilicus/trusted_certs/trusted_certs_main.py,sha256=6dHHWXvNIcUa_nA9ptigL4Vibe4n
2605
2605
  agilicus/users.py,sha256=JT7TIiUOtSFXPOdxmIVFm7ygZTH1FjsIkD9j-vjLuMM,38474
2606
2606
  agilicus/version.py,sha256=G9OFdL1v_4dLDfk6I6taDNypM5bbO-JHAwilsu9LYgg,23
2607
2607
  agilicus/whoami.py,sha256=kqghtWMgZOd2rhKmfguDwCTm6A3gNS8Kj-S2IBxBtl0,206
2608
- agilicus-1.261.5.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2609
- agilicus-1.261.5.dist-info/METADATA,sha256=ux6uBBYzh5EWC7crDzsmWUObRK2HxqFGLaMbQVknhaw,3873
2610
- agilicus-1.261.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
2611
- agilicus-1.261.5.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2612
- agilicus-1.261.5.dist-info/RECORD,,
2608
+ agilicus-1.262.0.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2609
+ agilicus-1.262.0.dist-info/METADATA,sha256=7Am7Ox82XSlU0cDHZirwSdtuAQep7hDLvuR2bWPDSUI,3873
2610
+ agilicus-1.262.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
2611
+ agilicus-1.262.0.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2612
+ agilicus-1.262.0.dist-info/RECORD,,