Skip to content

[Imprv] Add project_ext_id and share/unshare project operations to existing modules for Projects 2.0 #943

@abhinavbansal29

Description

@abhinavbansal29

Summary

Add project_ext_id field support and share/unshare project operations to existing v2 modules to support Projects 2.0 (Multi-Domain) workflows. This enables entities to be associated with projects at creation time and shared/unshared with projects post-creation.
Docs: https://developers.internal.nutanix.com/

Scope

A. Modules requiring project_ext_id + Share/Unshare with Project operations

These modules need:

  1. project_ext_id field in create/update spec
  2. share_with_project action
  3. unshare_from_project action
    Some also support "all projects" variants.
    | # | Namespace | Entity | Module | Share | Share All | Unshare | Unshare All |
    |---|-----------|--------|--------|:-----:|:---------:|:-------:|:-----------:|
    | 1 | IAM | Directory Service | ntnx_directory_services_v2 | Yes | Yes | Yes | Yes |
    | 2 | IAM | SAML Identity Provider | ntnx_saml_identity_providers_v2 | Yes | Yes | Yes | Yes |
    | 3 | Prism | Categories | ntnx_categories_v2 | Yes | No | Yes | No |
    | 4 | Networking | Subnets | ntnx_subnets_v2 | Yes | No | Yes | No |
    | 5 | Networking | VPC | ntnx_vpcs_v2 | Yes | No | Yes | No |

Note: Virtual Switch also supports share/unshare but no existing module exists (module TBD or new feature).

B. Modules requiring only project_ext_id field addition

These modules only need the project_ext_id field added to the create/update spec (no share/unshare APIs).

# Namespace Entity Module
1 IAM Authorization Policies ntnx_authorization_policies_v2
2 IAM Roles ntnx_roles_v2
3 VMM VM (Create) ntnx_vms_v2
4 VMM Image ntnx_images_v2
5 VMM OVA ntnx_ova_v2
6 VMM Templates ntnx_templates_v2
7 Networking Floating IPs ntnx_floating_ips_v2
8 Networking Routes ntnx_routes_v2
9 Networking Routing Policies ntnx_pbrs_v2
10 Networking Network Functions No existing module
11 Flow Mgmt Address Groups ntnx_address_groups_v2
12 Flow Mgmt Service Groups ntnx_service_groups_v2
13 Flow Mgmt Network Security Policy ntnx_security_rules_v2
14 Flow Mgmt Entity Groups No existing module
15 Data Protection Recovery Points ntnx_recovery_points_v2
16 Data Policies Protection Policies ntnx_protection_policies_v2
17 Object Storage Object Store ntnx_object_stores_v2 (in metadata)
18 Volumes Volume Groups ntnx_volume_groups_v2

Implementation Details

project_ext_id field

  • Add project_ext_id (string, optional) to the Ansible spec of each module listed above
  • Pass as metadata.project_reference or equivalent v4 field in the API request body
  • Should be supported in state: present (create/update)

Share/Unshare operations (Section A modules only)

  • Add new state values or a separate action parameter:
    • share_with_project – share entity with a specific project
    • share_with_all_projects – share entity with all projects (where supported)
    • unshare_from_project – unshare entity from a specific project
    • unshare_from_all_projects – unshare entity from all projects (where supported)
  • Each operation requires the entity ext_id and (where applicable) project_ext_id

Todo

Per-module checklist (repeat for each module):

  • Add project_ext_id to Ansible spec & spec validator
  • Implement share/unshare actions (Section A modules)
  • Unit tests for project_ext_id and share/unshare
  • Sanity tests
  • Integration tests
  • Documentation & examples

Modules with share/unshare:

  • ntnx_directory_services_v2 – project_ext_id + share/unshare + share_all/unshare_all
  • ntnx_saml_identity_providers_v2 – project_ext_id + share/unshare + share_all/unshare_all
  • ntnx_categories_v2 – project_ext_id + share/unshare
  • ntnx_subnets_v2 – project_ext_id + share/unshare
  • ntnx_vpcs_v2 – project_ext_id + share/unshare

Modules with project_ext_id only:

  • ntnx_authorization_policies_v2
  • ntnx_roles_v2
  • ntnx_vms_v2
  • ntnx_images_v2
  • ntnx_ova_v2
  • ntnx_templates_v2
  • ntnx_floating_ips_v2
  • ntnx_routes_v2
  • ntnx_pbrs_v2
  • ntnx_address_groups_v2
  • ntnx_service_groups_v2
  • ntnx_security_rules_v2
  • ntnx_recovery_points_v2
  • ntnx_protection_policies_v2
  • ntnx_object_stores_v2
  • ntnx_volume_groups_v2

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions