agilicus 1.261.6__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.6/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.6".\
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.6
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
 
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agilicus
3
- Version: 1.261.6
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=UXySf5pgPia_XxyCifpg2srigwcUq3vcqQeQe44qEcI,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=uVw6TJKQ50CuyQhBVvzQzv10Lv0XSTFwLqh65ANKl0c,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=YudpAxUMpWPUBvdFogImGp10JNGEHfAvWVD0TCBKOfI,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
@@ -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
@@ -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.6.dist-info/LICENSE.txt,sha256=Zq4tqiCroC2CVrBB_PWjapRdvpae23nljdiaSkOzUho,1061
2609
- agilicus-1.261.6.dist-info/METADATA,sha256=T0InqbwjnI4ci-j8LLdAGjmlWlW4V_e8UQ_OjK2sFC4,3873
2610
- agilicus-1.261.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
2611
- agilicus-1.261.6.dist-info/entry_points.txt,sha256=a66hGozzLkHu0IewFzIMbSAhMTNTddUaA2T3_16Gb_s,51
2612
- agilicus-1.261.6.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,,