Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CALM-DSL changes for v3.7.2.2 #295

Merged
merged 77 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
9f729e3
Calm-39485 fix typo (#286)
GullapalliAkhil Oct 3, 2023
5070504
Bug/m calm calm 26009 fix typo library tasks help (#287)
GullapalliAkhil Oct 3, 2023
9d51200
(#calm-39483) Passing with_endpoints value to marketplace api spec (#…
richakumarii Oct 4, 2023
2409d05
(#CALM-39073) use raw string to store regex value in variables (#285)
Abhishekntnx Oct 4, 2023
7d8ba8d
Support any quotes in string during NDB decompile (#293)
utkarshb07 Oct 6, 2023
8be7d4a
Added strip secret for http rb task header (#289)
utkarshb07 Oct 6, 2023
02b3668
Task/m calm 39476 add all projects update marketplace (#294)
GullapalliAkhil Oct 6, 2023
69fce9d
(#CALM-39488) decompile static nic IP addresses (#291)
Abhishekntnx Oct 9, 2023
835b234
import library task cmd file fix (#295)
Hemanthvarkolu21 Oct 9, 2023
1008e58
Added check to not print secrets when compile command is called. (#296)
utkarshb07 Oct 9, 2023
188235f
Calm unpublish marketplace improvements (#297)
GullapalliAkhil Oct 10, 2023
6dd3c60
Added option to select which nutanix account to use. (#302)
kushjajal7 Oct 13, 2023
64630a7
Allow read_local_file to read from default value if file does not exi…
naveenuk2411 Oct 13, 2023
29ec87e
(#CALM-39487) endpoints in blueprint (#290)
Abhishekntnx Oct 16, 2023
0b9576b
Bug/calm 39137 fix variaible basic auth (#301)
Abhishekntnx Oct 16, 2023
7c00d90
Add force flag to create projects and environments (#307)
GullapalliAkhil Oct 17, 2023
0a6c2d9
Updated comments to support basic auth with credentials in HTTP task …
dwivediprab Oct 17, 2023
dd06edb
Resourcetype list fetched from accounts_uuid_resource_types_list api …
richakumarii Oct 18, 2023
4b51cba
Bug/calm 32835 overlay subnets vpc name (#315)
prakharsingh1000 Oct 18, 2023
df8e626
(#CALM-40640) handle no auth in attrs in variable (#314)
Abhishekntnx Oct 18, 2023
d1509c3
Task/m calm 40651 fix ndb account collection failure (#318)
dwivediprab Oct 19, 2023
d5bff86
(#CALM-39478) Fix Azure env credential reference readiness probe (#320)
naveenuk2411 Oct 25, 2023
54d50b8
Added null check for resource types (#329)
richakumarii Oct 25, 2023
11e0e2b
added secrets to local file for NDB task (#333)
abhijeetkaurav1st Oct 29, 2023
3043429
Bug/m calm 39484 secrets hide in compile (#311)
utkarshb07 Oct 31, 2023
6741915
added permissions to project ACPs (#322)
utkarshb07 Nov 7, 2023
207b888
Resourcetype value assigned when None (#340)
richakumarii Nov 7, 2023
8477573
Made initial changes. #CALM-39459 (#300)
kapoor-nimish Nov 9, 2023
20b8306
added support for downloadable images in simple bp model (#327)
dwivediprab Nov 15, 2023
b34e668
fixed vmware brownfield app creation (#272)
dwivediprab Nov 15, 2023
af397bf
Task/m calm 40059 no expiration for reocurring jobs (#283)
dwivediprab Nov 29, 2023
221a0a6
Task/m calm 39460 project decompile (#341)
kapoor-nimish Nov 30, 2023
aa36d94
Fixed unit test data. #CALM-41328 (#347)
kapoor-nimish Nov 30, 2023
c2fc440
Bug/m calm 39466 add more validation when checking for valid provider…
Jetx23 Dec 1, 2023
3da1569
Bug/39473 include watch w with calm create app (#299)
Jetx23 Dec 1, 2023
7d99b28
Bug/39475 show more details in the describe app command (#312)
Jetx23 Dec 1, 2023
c03f4ed
added filter_by field (#350)
dwivediprab Dec 5, 2023
db1fcc9
added fix for developer and custom role (#349)
utkarshb07 Dec 6, 2023
c0ffcba
fixed bp initialization with project having overlay subnet (#351)
dwivediprab Dec 8, 2023
c99c8d5
fixed keyerror (#360)
dwivediprab Dec 26, 2023
4fabe78
Bug/m calm 42087 fix get accounts command when nutanix provider (#361)
dwivediprab Dec 26, 2023
d84a17a
#CALM-39951, skip test until eng issue is fixed (#374)
santhoshkv Jan 18, 2024
8d25192
Task/r380 add nightly marker dsl (#377)
GullapalliAkhil Feb 2, 2024
34d7937
Use environment attribute and fix nic extraction from env cache (#378)
abhijeetkaurav1st Feb 12, 2024
6aa1a63
Delete app post reset of tunnel VM using reset command. (#379)
bhati-pradeep Feb 19, 2024
1cda352
fixed quota resources read call to quota api (#384)
dwivediprab Mar 4, 2024
1939fa6
process packages of type CUSTOM (#385)
HSDeshpande Mar 4, 2024
62726f8
FIxed decompilation of boot type (#390)
dwivediprab Mar 6, 2024
6498a2b
CALM-43480: Fix decompile failure of while task loop (#393)
dwivediprab Mar 7, 2024
7e54070
Publish mpi with all projects in PENDING STATE (#372)
dwivediprab Mar 7, 2024
c1cf787
CALM-43487: cluster macro is not supported in command calm decompile …
dwivediprab Mar 12, 2024
8bb5bc4
fix get app command with "deleted state" filter (#391)
dwivediprab Mar 12, 2024
2f9f3e3
Task/m calm 30977 add vm power state field in vm configuration (#348)
dwivediprab Mar 15, 2024
e0ffa00
updated cache with new config (#304)
dwivediprab Mar 15, 2024
8708e1d
[App-Edit] Support for patch config actions in app describe/decompile…
dwivediprab Mar 15, 2024
044c1c0
Support to create snapshot configs for vmware (#375)
dwivediprab Mar 15, 2024
62fb66d
Regression fixes for 3722 beta release (#397)
dwivediprab Mar 18, 2024
17fa77c
(#CALM-43042) Migrate escripts in DSL tests to py3 (#386)
eqbalomar Mar 11, 2024
ac7c082
Regression fixes for 3722 (#398)
dwivediprab Mar 18, 2024
3f7d08f
CALM-43784: Decompile fix for power actions in post create (#403)
dwivediprab Mar 21, 2024
f2a756f
CALM-43760: DSL Build failure due to incorrect context use while sync…
dwivediprab Mar 26, 2024
17483ef
CALM-43867: Fixes app update for partial configs (#407)
dwivediprab Apr 4, 2024
02e7f9f
Revert "added fix for developer and custom role (#349)"
dwivediprab Apr 22, 2024
1a94680
Revert "added permissions to project ACPs (#322)"
dwivediprab Apr 22, 2024
628a200
added release calm version
dwivediprab Apr 22, 2024
48bb3af
Fix patch config Nonetype error (#416)
dwivediprab Apr 12, 2024
877ae5a
CALM-44168: Fix update config failure (#414)
dwivediprab Apr 12, 2024
2d115ad
Python Sanity Fixes (#420)
dwivediprab Apr 18, 2024
75e3226
Fix environment decompile (#422)
dwivediprab Apr 19, 2024
bd2d17f
Merge pull request #294 from nutanix/task/3722-revert-acp-related-com…
abhijeetkaurav1st Apr 23, 2024
a9c954d
(#CALM-39487) change target to target_endpoint for endpoint reference…
Abhishekntnx Apr 22, 2024
21c2109
CALM-44462: Fix strip_vmware_secrets function (#425)
dwivediprab Apr 23, 2024
35d2f15
Removing new python remote decompile (#426)
dwivediprab Apr 24, 2024
b87bcb7
Merge branch 'dsl-release-3722-beta' of github.com:nutanix/calm-dsl i…
dwivediprab Apr 24, 2024
ac9dded
Release notes for DSL v3722 (#399)
dwivediprab Apr 25, 2024
18ae61f
Fix black in github action workfile (#421)
dwivediprab Apr 18, 2024
c5e7960
fix release notes (#428)
dwivediprab Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: black
if: ${{matrix.python-version != '3.7'}}
uses: psf/black@stable # Exclude list is not honored - https://github.com/psf/black/issues/1584
with:
version: "22.6.0"
Expand Down
2 changes: 1 addition & 1 deletion CalmVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.2.1
3.7.2.2
401 changes: 401 additions & 0 deletions Documentation/docs/models/runbook/ndb_task.md

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ Use `calm get roles` to list all roles in PC. The below roles are relevant for C

### Projects
- Compile project: `calm compile project --file <project_file_location>`. This command will print the compiled project JSON. Look at sample file [here](examples/Project/demo_project.py) and [here](examples/Project/project_with_env.py).
- Create project on Calm Server: `calm create project --file <project_file_location> --name <project_name> --description <description>`. Use `no-cache-update` flag to skip cache updations post operation.
- Create project on Calm Server: `calm create project --file <project_file_location> --name <project_name> --description <description>`.\
**Options:**\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `--no-cache-update`: flag to skip cache updations post operation.\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `--force`: flag to delete existing project with the same name before create, if entities are not associated with it.

- List projects: `calm get projects`. Get projects, optionally filtered by a string
- Describe project: `calm describe project <project_name>`. It will print summary of project.
- Update project using dsl file: `calm update project <project_name> --file <project_file_location>`. Environments will not be updated as part of this operation. Use `no-cache-update` flag to skip cache updations post operation.
Expand All @@ -162,13 +166,22 @@ Use `calm get roles` to list all roles in PC. The below roles are relevant for C
- If the project already has quotas set and enabled and there are no quotas in {project_file} then the original quotas in the projects would be persisted.
- If the project doesn't have quotas enabled/set and the {project_file} has quotas then the quotas would be enabled and set in the project.
- Note: While using `no-cache-update` flag in project create and update commands, user should not pass environment object in the project model. User should update the cache separately after creation/updation of projects. Feature is experimental and will be discontinued after [#184](https://github.com/nutanix/calm-dsl/issues/184) is fixed.
- Decompile existing server project: `calm decompile project <project_name>`.
- Decompile project from existing json file: `calm decompile project --file <json_file_location>`.
- Decompile project to a location: `calm decompile project <project_name> --dir <project_dir>`. It will decompile project entities to `project_dir` location.

### Environments
- Compile environment: `calm compile environment --file <env_file_location> --project <project_name>`. Command will print the compiled environment JSON. Look at sample file [here](examples/Environment/sample_environment.py)
- Create environment to existing project: `calm create environment --file <env_file_location> --project <project_name> --name <environmet_name>`. Use `no-cache-update` flag to skip cache updations post operation.
- Create environment to existing project: `calm create environment --file <env_file_location> --project <project_name> --name <environmet_name>`.\
**Options:**\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `--no-cache-update`: flag to skip cache updations post operation.\
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `--force`: flag to delete existing environment in a project with the same name before create, if entities are not associated with it.
- Update environment: `calm update environment <environment_name> --file <env_file_location> --project <project_name>`. Use `no-cache-update` flag to skip cache updations post operation.
- List environments: `calm get environments --project <project_name>`. Get environments of project.
- Delete environment: `calm delete environment <environment_name> --project <project_name>`. Use `no-cache-update` flag to skip cache updations post operation.
- Decompile existing server environment: `calm decompile environment <environment_name> --project <project_name>`.
- Decompile environment from existing json file: `calm decompile environment --file <json_file_location> --project <project_name>`.
- Decompile environment to a location: `calm decompile environment <environment_name> --project <project_name> --dir <environment_dir>`. It will decompile environment entities to `environment_dir` location.

### Access Control Policies
Access control policies ensures that a project member can access only the entities or perform only the actions defined in the role assigned to that project member.
Expand Down
3 changes: 2 additions & 1 deletion calm/dsl/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from .handle import get_client_handle_obj, get_api_client
from .handle import get_client_handle_obj, get_api_client, reset_api_client_handle
from .resource import get_resource_api

__all__ = [
"get_client_handle_obj",
"get_api_client",
"get_resource_api",
"reset_api_client_handle",
]
37 changes: 35 additions & 2 deletions calm/dsl/api/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from .util import (
strip_secrets,
patch_secrets,
strip_patch_config_tasks,
add_patch_config_tasks,
)
from calm.dsl.log import get_logging_handle

Expand Down Expand Up @@ -191,6 +193,8 @@ def upload_with_secrets(
bp_resources, secret_map, secret_variables, object_lists=object_lists
)

# Removing patch config tasks before uploading
profile_patch_config_tasks = strip_patch_config_tasks(bp_resources)
for obj_index, obj in enumerate(
bp_resources.get("substrate_definition_list", []) or []
):
Expand All @@ -210,10 +214,23 @@ def upload_with_secrets(
if err:
return res, err

# Add secrets and update bp
# Add secrets, patch config tasks and update bp
bp = res.json()
service_name_uuid_map = {}
app_profile_list = bp["status"].get("resources", {}).get("app_profile_list", [])
for service in (
bp["status"].get("resources", {}).get("service_definition_list", [])
):
service_name_uuid_map[service["name"]] = service["uuid"]
del bp["status"]

add_patch_config_tasks(
bp["spec"]["resources"],
app_profile_list,
profile_patch_config_tasks,
service_name_uuid_map,
)

patch_secrets(bp["spec"]["resources"], secret_map, secret_variables)

# Adding categories at PUT call to blueprint
Expand Down Expand Up @@ -273,6 +290,9 @@ def upload_with_decompiled_secrets(
not_stripped_secrets=not_stripped_secrets,
)

# Removing patch config tasks before uploading
profile_patch_config_tasks = strip_patch_config_tasks(bp_resources)

for obj_index, obj in enumerate(
bp_resources.get("substrate_definition_list", []) or []
):
Expand All @@ -299,10 +319,23 @@ def upload_with_decompiled_secrets(
if err:
return res, err

# Add secrets and update bp
# Add secrets, patch config tasks and update bp
bp = res.json()
service_name_uuid_map = {}
app_profile_list = bp["status"].get("resources", {}).get("app_profile_list", [])
for service in (
bp["status"].get("resources", {}).get("service_definition_list", [])
):
service_name_uuid_map[service["name"]] = service["uuid"]
del bp["status"]

add_patch_config_tasks(
bp["spec"]["resources"],
app_profile_list,
profile_patch_config_tasks,
service_name_uuid_map,
)

LOG.info("Patching newly created/updated secrets")
for k in secret_map:
LOG.debug("[CREATED/MODIFIED] credential -> '{}'".format(k))
Expand Down
7 changes: 7 additions & 0 deletions calm/dsl/api/handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,10 @@ def get_api_client():
update_api_client(host=pc_ip, port=pc_port, auth=(username, password))

return _API_CLIENT_HANDLE


def reset_api_client_handle():
"""resets global api client object (_API_CLIENT_HANDLE)"""

global _API_CLIENT_HANDLE
_API_CLIENT_HANDLE = None
Loading
Loading