netapp_ontap.resources.consistency_group API documentation
Description: Copyright &copy; 2026 NetApp Inc. All rights reserved …

# Module `netapp_ontap.resources.consistency_group`

Copyright © 2026 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

## Overview

A consistency group is a group of volumes that supports capabilities such as creating a snapshot of all of its member volumes at the same point-in-time with a write-fence, thus ensuring a consistent image of the volumes at that time.
Applications with datasets scoped to a single volume can have its contents saved to a snapshot, replicated, or cloned in a crash-consistent manner implicitly with corresponding native ONTAP volume-granular operations. Applications with datasets spanning a group of multiple volumes must have such operations performed on the group. Typically, by first fencing writes to all the volumes in the group, flushing any writes pending in queues, executing the intended operation, that is, take snapshot of every volume in the group and when that is complete, unfence and resume writes. A consistency group is the conventional mechanism for providing such group semantics.

## Consistency group APIs

The following APIs are used to perform operations related to consistency groups:

- GET /api/application/consistency-groups
- POST /api/application/consistency-groups
- GET /api/application/consistency-groups/{uuid}
- PATCH /api/application/consistency-groups/{uuid}
- DELETE /api/application/consistency-groups/{uuid}

## Examples

### Retrieving all consistency groups of an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(list(ConsistencyGroup.get_collection(**{"svm.name": "vs1"})))

Try it out

    [
        ConsistencyGroup(
            {
                "name": "vol1",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
            }
        ),
        ConsistencyGroup(
            {
                "name": "parent_cg",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b22c85-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
            }
        ),
        ConsistencyGroup(
            {
                "name": "child_1",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b270b1-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "c1b270b1-0a82-11ec-a449-005056bbcf9f",
            }
        ),
        ConsistencyGroup(
            {
                "name": "child_2",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b270c3-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "c1b270c3-0a82-11ec-a449-005056bbcf9f",
            }
        ),
    ]

### Retrieving details of all consistency groups of an SVM

Retrieving details of the consistency groups for a specified SVM. These details are considered to be performant and will return within 1 second when 40 records or less are requested.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(
            list(
                ConsistencyGroup.get_collection(
                    fields="*", max_records=40, **{"svm.name": "vs1"}
                )
            )
        )

Try it out

    [
        ConsistencyGroup(
            {
                "name": "vol1",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f"
                    }
                },
                "space": {"available": 107704320, "size": 108003328, "used": 299008},
                "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
                "replicated": False,
                "svm": {
                    "name": "vs1",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
                },
            }
        ),
        ConsistencyGroup(
            {
                "name": "parent_cg",
                "snapshot_policy": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/snapshot-policies/a30bd0fe-067d-11ec-a449-005056bbcf9f"
                        }
                    },
                    "name": "default-1weekly",
                    "uuid": "a30bd0fe-067d-11ec-a449-005056bbcf9f",
                },
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b22c85-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "space": {"available": 78696448, "size": 83886080, "used": 995328},
                "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
                "consistency_groups": [
                    {
                        "_links": {
                            "self": {
                                "href": "/api/application/consistency-groups/c1b270b1-0a82-11ec-a449-005056bbcf9f"
                            }
                        },
                        "space": {"available": 39346176, "size": 41943040, "used": 499712},
                        "name": "child_1",
                        "uuid": "c1b270b1-0a82-11ec-a449-005056bbcf9f",
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "/api/application/consistency-groups/c1b270c3-0a82-11ec-a449-005056bbcf9f"
                            }
                        },
                        "space": {"available": 39350272, "size": 41943040, "used": 495616},
                        "name": "child_2",
                        "uuid": "c1b270c3-0a82-11ec-a449-005056bbcf9f",
                    },
                ],
                "replicated": False,
                "svm": {
                    "name": "vs1",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
                },
            }
        ),
        ConsistencyGroup(
            {
                "name": "child_1",
                "snapshot_policy": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/snapshot-policies/a30b60a4-067d-11ec-a449-005056bbcf9f"
                        }
                    },
                    "name": "default",
                    "uuid": "a30b60a4-067d-11ec-a449-005056bbcf9f",
                },
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b270b1-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "space": {"available": 39346176, "size": 41943040, "used": 499712},
                "parent_consistency_group": {
                    "name": "parent_cg",
                    "_links": {
                        "self": {
                            "href": "/api/application/consistency-groups/c1b22c85-0a82-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
                },
                "uuid": "c1b270b1-0a82-11ec-a449-005056bbcf9f",
                "svm": {
                    "name": "vs1",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
                },
            }
        ),
        ConsistencyGroup(
            {
                "name": "child_2",
                "snapshot_policy": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/snapshot-policies/a30b60a4-067d-11ec-a449-005056bbcf9f"
                        }
                    },
                    "name": "default",
                    "uuid": "a30b60a4-067d-11ec-a449-005056bbcf9f",
                },
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b270c3-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "space": {"available": 39350272, "size": 41943040, "used": 495616},
                "parent_consistency_group": {
                    "name": "parent_cg",
                    "_links": {
                        "self": {
                            "href": "/api/application/consistency-groups/c1b22c85-0a82-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
                },
                "uuid": "c1b270c3-0a82-11ec-a449-005056bbcf9f",
                "svm": {
                    "name": "vs1",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"
                        }
                    },
                    "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
                },
            }
        ),
    ]

### Retrieving details of non-nested consistency groups

Retrieves details of the consistency groups without nested consistency groups, or only the parent consistency group for a number of consistency groups of a specified SVM.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(
            list(
                ConsistencyGroup.get_collection(
                    **{"svm.name": "vs1", "parent_consistency_group.uuid": "null"}
                )
            )
        )

Try it out

    [
        ConsistencyGroup(
            {
                "name": "vol1",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
                "svm": {"name": "vs1"},
            }
        ),
        ConsistencyGroup(
            {
                "name": "parent_cg",
                "_links": {
                    "self": {
                        "href": "/api/application/consistency-groups/c1b22c85-0a82-11ec-a449-005056bbcf9f"
                    }
                },
                "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
                "svm": {"name": "vs1"},
            }
        ),
    ]

### Creating a single consistency group with a new SAN volume

Provisions an application with one consistency group, each with one new SAN volumes, with one LUN, an igroup and no explicit snapshot policy, FabricPool tiering policy, storage service, and QoS policy specification. The igroup to map a LUN to is specified at LUN-granularity.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup()
        resource.svm = {"name": "vs1"}
        resource.luns = [
            {
                "name": "/vol/vol1/lun1",
                "space": {"size": "100mb"},
                "os_type": "linux",
                "lun_maps": [
                    {
                        "igroup": {
                            "name": "igroup1",
                            "initiators": [{"name": "example_name"}],
                        }
                    }
                ],
            }
        ]
        resource.post(hydrate=True)
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "vol1",
            "luns": [
                {
                    "lun_maps": [
                        {
                            "igroup": {
                                "name": "igroup1",
                                "initiators": [{"name": "example_name"}],
                            }
                        }
                    ],
                    "space": {"size": 104857600},
                    "name": "/vol/vol1/lun1",
                    "os_type": "linux",
                }
            ],
            "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
            "svm": {
                "name": "vs1",
                "_links": {
                    "self": {"href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"}
                },
                "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
            },
        }
    )

### Creating an Application with two consistency groups with existing SAN volumes

Provisions an application with two consistency groups, each with two existing SAN volumes, a snapshot policy at application-granularity, and a distinct consistency group granular snapshot policy.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup()
        resource.svm = {"name": "vs1"}
        resource.name = "parent_cg"
        resource.snapshot_policy = {"name": "default-1weekly"}
        resource.consistency_groups = [
            {
                "name": "child_1",
                "snapshot_policy": {"name": "default"},
                "volumes": [
                    {"name": "existing_vol1", "provisioning_options": {"action": "add"}},
                    {"name": "existing_vol2", "provisioning_options": {"action": "add"}},
                ],
            },
            {
                "name": "child_2",
                "snapshot_policy": {"name": "default"},
                "volumes": [
                    {"name": "existing_vol3", "provisioning_options": {"action": "add"}},
                    {"name": "existing_vol4", "provisioning_options": {"action": "add"}},
                ],
            },
        ]
        resource.post(hydrate=True)
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "parent_cg",
            "snapshot_policy": {"name": "default-1weekly"},
            "uuid": "c1b22c85-0a82-11ec-a449-005056bbcf9f",
            "consistency_groups": [
                {
                    "snapshot_policy": {"name": "default"},
                    "name": "child_1",
                    "uuid": "c1b270b1-0a82-11ec-a449-005056bbcf9f",
                    "volumes": [{"name": "existing_vol1"}, {"name": "existing_vol2"}],
                },
                {
                    "snapshot_policy": {"name": "default"},
                    "name": "child_2",
                    "uuid": "c1b270c3-0a82-11ec-a449-005056bbcf9f",
                    "volumes": [{"name": "existing_vol3"}, {"name": "existing_vol4"}],
                },
            ],
            "svm": {
                "name": "vs1",
                "_links": {
                    "self": {"href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"}
                },
                "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
            },
        }
    )

### Retrieving specific details of an existing consistency group

Retrieves the details of an existing consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f48d798-0a7f-11ec-a449-005056bbcf9f")
        resource.get()
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "vol1",
            "_links": {
                "self": {
                    "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f"
                }
            },
            "space": {"available": 107724800, "size": 108003328, "used": 278528},
            "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
            "replicated": False,
            "svm": {
                "name": "vs1",
                "_links": {
                    "self": {"href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"}
                },
                "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
            },
        }
    )

### Retrieving all details of an existing consistency group

Retrieves all details of an existing consistency group. These details are expensive and are not guaranteed to return within one second.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f48d798-0a7f-11ec-a449-005056bbcf9f")
        resource.get(fields="**")
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "vol1",
            "tiering": {"policy": "none"},
            "luns": [
                {
                    "serial_number": "wIqM6]RfQK3t",
                    "lun_maps": [
                        {
                            "igroup": {
                                "protocol": "mixed",
                                "name": "igroup1",
                                "initiators": [{"name": "example_name"}],
                                "os_type": "linux",
                                "uuid": "6f4a4b86-0a7f-11ec-a449-005056bbcf9f",
                            },
                            "logical_unit_number": 0,
                        }
                    ],
                    "space": {
                        "size": 104857600,
                        "used": 0,
                        "guarantee": {"reserved": False, "requested": False},
                    },
                    "name": "/vol/vol1/lun1",
                    "os_type": "linux",
                    "uuid": "6f51748a-0a7f-11ec-a449-005056bbcf9f",
                    "create_time": "2021-08-31T13:18:24-04:00",
                }
            ],
            "_links": {
                "self": {
                    "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f?fields=**"
                }
            },
            "qos": {
                "policy": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/qos/policies/b7189398-e572-48ab-8f69-82cd46580812"
                        }
                    },
                    "name": "extreme-fixed",
                    "uuid": "b7189398-e572-48ab-8f69-82cd46580812",
                }
            },
            "space": {"available": 107569152, "size": 108003328, "used": 434176},
            "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
            "volumes": [
                {
                    "qos": {
                        "policy": {
                            "_links": {
                                "self": {
                                    "href": "/api/storage/qos/policies/b7189398-e572-48ab-8f69-82cd46580812"
                                }
                            },
                            "name": "extreme-fixed",
                            "uuid": "b7189398-e572-48ab-8f69-82cd46580812",
                        }
                    },
                    "snapshot_policy": {
                        "name": "default",
                        "uuid": "a30b60a4-067d-11ec-a449-005056bbcf9f",
                    },
                    "space": {"available": 107569152, "size": 108003328, "used": 434176},
                    "name": "vol1",
                    "uuid": "6f516c6c-0a7f-11ec-a449-005056bbcf9f",
                    "comment": "",
                    "tiering": {"policy": "none"},
                }
            ],
            "replicated": False,
            "svm": {
                "name": "vs1",
                "_links": {
                    "self": {"href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"}
                },
                "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
            },
        }
    )

### Retrieving all details of an existing consistency group

Retrieves all details of an existing consistency group. These details are expensive and are not guaranteed to return within one second.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f48d798-0a7f-11ec-a449-005056bbcf9f")
        resource.get(fields="**")
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "vol1",
            "tiering": {"policy": "none"},
            "_links": {
                "self": {
                    "href": "/api/application/consistency-groups/6f48d798-0a7f-11ec-a449-005056bbcf9f?fields=**"
                }
            },
            "qos": {
                "policy": {
                    "_links": {
                        "self": {
                            "href": "/api/storage/qos/policies/b7189398-e572-48ab-8f69-82cd46580812"
                        }
                    },
                    "name": "extreme-fixed",
                    "uuid": "b7189398-e572-48ab-8f69-82cd46580812",
                }
            },
            "space": {"available": 107569152, "size": 108003328, "used": 434176},
            "uuid": "6f48d798-0a7f-11ec-a449-005056bbcf9f",
            "volumes": [
                {
                    "qos": {
                        "policy": {
                            "_links": {
                                "self": {
                                    "href": "/api/storage/qos/policies/b7189398-e572-48ab-8f69-82cd46580812"
                                }
                            },
                            "name": "extreme-fixed",
                            "uuid": "b7189398-e572-48ab-8f69-82cd46580812",
                        }
                    },
                    "snapshot_policy": {
                        "name": "default",
                        "uuid": "a30b60a4-067d-11ec-a449-005056bbcf9f",
                    },
                    "space": {"available": 107569152, "size": 108003328, "used": 434176},
                    "name": "vol1",
                    "uuid": "6f516c6c-0a7f-11ec-a449-005056bbcf9f",
                    "comment": "",
                    "tiering": {"policy": "none"},
                }
            ],
            "replicated": False,
            "svm": {
                "name": "vs1",
                "_links": {
                    "self": {"href": "/api/svm/svms/4853f97a-0a63-11ec-a449-005056bbcf9f"}
                },
                "uuid": "4853f97a-0a63-11ec-a449-005056bbcf9f",
            },
        }
    )

### Adding LUNs to an existing volume in an existing consistency group

Adds two NVMe namespaces to an existing volume in an existing consistency group, creates a new subsystem, and binds the new namespaces to it.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f48d798-0a7f-11ec-a449-005056bbcf9f")
        resource.luns = [
            {
                "name": "/vol/vol1/new_luns",
                "provisioning_options": {"count": 2, "action": "create"},
                "space": {"size": "100mb"},
                "os_type": "linux",
                "lun_maps": [
                    {
                        "igroup": {
                            "name": "igroup2",
                            "initiators": [{"name": "01:02:03:04:05:06:07:01"}],
                        }
                    }
                ],
            }
        ]
        resource.patch()

### Restoring a consistency group to the contents of an existing snapshot

Restores an existing consistency group to the contents of an existing snapshot of the consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.restore_to = {"snapshot": {"uuid": "92c6c770-17a1-11eb-b141-005056acd498"}}
        resource.patch()

### Deleting a consistency group

Deletes a consistency group, where all storage originally associated with that consistency group remains in place.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f48d798-0a7f-11ec-a449-005056bbcf9f")
        resource.delete()

### Cloning an existing consistency group

The following example clones an existing consistency group with the current contents:

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup()
        resource.name = "clone01_of_cg01"
        resource.svm = {"name": "vs_0"}
        resource.clone = {
            "volume": {"prefix": "my_clone_pfx", "suffix": "my_clone_sfx"},
            "split_initiated": True,
            "parent_consistency_group": {
                "name": "cg01",
                "uuid": "ca5e76fb-98c0-11ec-855a-005056a7693b",
            },
            "guarantee": {"type": "none"},
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "clone01_of_cg01",
            "clone": {
                "split_initiated": True,
                "volume": {"suffix": "my_clone_sfx", "prefix": "my_clone_pfx"},
                "guarantee": {"type": "none"},
                "parent_consistency_group": {
                    "name": "cg01",
                    "uuid": "ca5e76fb-98c0-11ec-855a-005056a7693b",
                },
            },
            "svm": {"name": "vs_0"},
        }
    )

### Cloning a consistency group from an existing snapshot

The following example clones an existing consistency group with contents from an existing snapshot:

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup()
        resource.name = "clone01_of_cg01"
        resource.svm = {"name": "vs_0"}
        resource.clone = {
            "volume": {"prefix": "my_clone_pfx", "suffix": "my_clone_sfx"},
            "split_initiated": True,
            "parent_snapshot": {"name": "snap01_of_cg01"},
            "parent_consistency_group": {
                "name": "cg01",
                "uuid": "ca5e76fb-98c0-11ec-855a-005056a7693b",
            },
            "guarantee": {"type": "none"},
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "clone01_of_cg01",
            "clone": {
                "split_initiated": True,
                "volume": {"suffix": "my_clone_sfx", "prefix": "my_clone_pfx"},
                "guarantee": {"type": "none"},
                "parent_consistency_group": {
                    "name": "cg01",
                    "uuid": "ca5e76fb-98c0-11ec-855a-005056a7693b",
                },
                "parent_snapshot": {"name": "snap01_of_cg01"},
            },
            "svm": {"name": "vs_0"},
        }
    )

### Adding namespaces to an existing volume in an existing consistency group

To add two NVMe Namespaces to an existing volume in an existing consistency group, create a new subsystem and bind the new namespaces to it.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.namespaces = [
            {
                "name": "/vol/vol1/new_namespace",
                "space": {"size": "10M"},
                "os_type": "windows",
                "provisioning_options": {"count": 2},
                "subsystem_map": {
                    "subsystem": {
                        "name": "mySubsystem",
                        "hosts": [
                            {
                                "nqn": "nqn.1992-08.com.netapp:sn.d04594ef915b4c73b642169e72e4c0b1:subsystem.host1"
                            },
                            {
                                "nqn": "nqn.1992-08.com.netapp:sn.d04594ef915b4c73b642169e72e4c0b1:subsystem.host2"
                            },
                        ],
                    }
                },
            }
        ]
        resource.patch()

### Add a new volume in an existing consistency group

The following example adds two new volumes to an existing consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.volumes = [
            {
                "name": "new_vol_",
                "provisioning_options": {"count": "2"},
                "space": {"size": "1gb"},
            }
        ]
        resource.patch()

### Adding an existing volume to an existing consistency group

The following example adds an existing volume to an existing consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.volumes = [
            {"name": "existing_vol", "provisioning_options": {"action": "add"}}
        ]
        resource.patch()

### Promoting a single consistency group to a nested consistency group

The following example promotes a single consistency group to a nested consistency group with a new child consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.provisioning_options = {"action": "promote"}
        resource.consistency_groups = [
            {"name": "cg_child", "provisioning_options": {"action": "create"}}
        ]
        resource.patch()

### Demoting a nested consistency group to a single consistency group

The following example demotes (flattens) a nested consistency group to a single consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.provisioning_options = {"action": "demote"}
        resource.patch()

### Adding a new child consistency group to nested consistency group

The following example adds a new child consistency group to an existing nested consistency group, creating a new volume.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.consistency_groups = [
            {
                "name": "cg_child5",
                "provisioning_options": {"action": "create"},
                "volumes": [{"name": "child5_vol_1", "space": {"size": "100mb"}}],
            }
        ]
        resource.patch()

### Removing a child consistency group from nested consistency group

The following example removes a child consistency group from a nested consistency, changing it to a single consistency group with a new consistency group name.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.consistency_groups = [
            {
                "name": "cg_child5",
                "provisioning_options": {"action": "remove", "name": "new_single_cg"},
            }
        ]
        resource.patch()

### Create a new parent consistency group with an existing consistency group

The following example creates a new nested consistency group with an existing consistency group as child consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup()
        resource.svm = {"name": "vs1"}
        resource.name = "cg_parent2"
        resource.consistency_groups = [
            {"name": "cg_large", "provisioning_options": {"action": "add"}},
            {"name": "cg_standalone2", "provisioning_options": {"action": "add"}},
        ]
        resource.post(hydrate=True)
        print(resource)

Try it out

    ConsistencyGroup(
        {
            "name": "cg_parent2",
            "consistency_groups": [
                {"provisioning_options": {"action": "add"}, "name": "cg_large"},
                {"provisioning_options": {"action": "add"}, "name": "cg_standalone2"},
            ],
            "svm": {"name": "vs1"},
        }
    )

### Reassign a volume to another child consistency group.

The following example reassigns a volume from a child consistency group to another child consistency group with the same parent consistency group.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import ConsistencyGroup

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = ConsistencyGroup(uuid="6f51748a-0a7f-11ec-a449-005056bbcf9f")
        resource.consistency_groups = [
            {
                "name": "cg_child1",
                "volumes": [
                    {"name": "child2_vol_1", "provisioning_options": {"action": "reassign"}}
                ],
            },
            {"name": "cg_child2"},
        ]
        resource.patch()

## Classes

`class ConsistencyGroup (*args, **kwargs)`

  Allows interaction with ConsistencyGroup objects on the host

  Initialize the instance of the resource.

  Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

      MyResource(name='foo').name == 'foo'

  ## Args

  `*args`
    Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
  `**kwargs`
    each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

  ### Ancestors

  - Resource

  ### Static methods

  `def count_collection (*args, connection: HostConnection = None, **kwargs) -> int`

    Returns a count of all ConsistencyGroup resources that match the provided query

    This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the count of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. These query parameters can affect the count. A return_records query param will be ignored.

    ## Returns

    On success, returns an integer count of the objects of this type. On failure, returns -1.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library.

  `def delete_collection (*args, records: Iterable[ForwardRef('ConsistencyGroup')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Deletes a consistency group.
    Note this will not delete any associated volumes or LUNs. To delete those elements, use the appropriate object endpoint.

    ## Related ONTAP commands

    - `vserver consistency-group delete`

    ### Learn more

    - `DOC /application/consistency-groups`

    Delete all objects in a collection which match the given query.

    All records on the host which match the query will be deleted.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
    `records`
      Can be provided in place of a query. If so, this list of objects will be deleted from the host.
    `body`
      The body of the delete request. This could be a Resource instance or a dictionary object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be deleted.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def fast_get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[RawResource]`

    Returns a list of RawResources that represent ConsistencyGroup resources that match the provided query

    Fetch a list of all objects of this type from the host.

        This is a lazy fetch, making API calls only as necessary when the result
        of this call is iterated over. For instance, if max_records is set to 5,
        then iterating over the collection causes an API call to be sent to the
        server once for every 5 records. If the client stops iterating before
        getting to the 6th record, then no additional API calls are made.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `max_records`
      The maximum number of records to return per call
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  `def find (*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieve details of a collection or a specific consistency group.

    ## Notes

    When volume granular properties, such as, the storage SLC, Fabric Pool tiering are not the same for all the existing volumes of a consistency group, the corresponding property is not reported at consistency group granularity. It is only reported if all the volumes of the consistency group have the same value for that property.
    If this consistency group instance has 1 or more replication relationships, the "replicated" parameter is true. If there are no associated replication relationships, it is false. This parameter is only included in the output for Single-CG and Parent-CG, not for Child-CG. If this consistency group instance has 1 or more replication relationships, the "replication_relationships" parameter is included in the output for Single-CG and Parent-CG instances. If there are no associated replication relationships, this parameter is not included in the output. Note that this parameter is an array and as such it has as many elements as the number of replication relationships associated with this consistency group. Each element of the array describes properties of one replication relationship associated with this consistency group. The "uuid" parameter identifies a specific replication relationship and the "href" parameter is a link to the corresponding SnapMirror relationship. The "is_source" parameter is true if this consistency group is the source in that relationship, otherwise it is false.

    ## Expensive properties

    There is an added computational cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the `fields` query parameter. See `DOC Requesting specific fields` to learn more. * `volumes` * `luns` * `namespaces`

    ## Related ONTAP commands

    - `vserver consistency-group show'

    ### Learn more

    - `DOC /application/consistency-groups`

    Find an instance of an object on the host given a query.

    The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found, None will be returned. If more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A `Resource` object containing the details of the object or None if no matches were found.

    ## Raises

    `NetAppRestError`: If the API call returned more than 1 matching resource.

  `def get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]`

    Retrieve details of a collection or a specific consistency group.

    ## Notes

    When volume granular properties, such as, the storage SLC, Fabric Pool tiering are not the same for all the existing volumes of a consistency group, the corresponding property is not reported at consistency group granularity. It is only reported if all the volumes of the consistency group have the same value for that property.
    If this consistency group instance has 1 or more replication relationships, the "replicated" parameter is true. If there are no associated replication relationships, it is false. This parameter is only included in the output for Single-CG and Parent-CG, not for Child-CG. If this consistency group instance has 1 or more replication relationships, the "replication_relationships" parameter is included in the output for Single-CG and Parent-CG instances. If there are no associated replication relationships, this parameter is not included in the output. Note that this parameter is an array and as such it has as many elements as the number of replication relationships associated with this consistency group. Each element of the array describes properties of one replication relationship associated with this consistency group. The "uuid" parameter identifies a specific replication relationship and the "href" parameter is a link to the corresponding SnapMirror relationship. The "is_source" parameter is true if this consistency group is the source in that relationship, otherwise it is false.

    ## Expensive properties

    There is an added computational cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the `fields` query parameter. See `DOC Requesting specific fields` to learn more. * `volumes` * `luns` * `namespaces`

    ## Related ONTAP commands

    - `vserver consistency-group show'

    ### Learn more

    - `DOC /application/consistency-groups`

    Fetch a list of all objects of this type from the host.

        This is a lazy fetch, making API calls only as necessary when the result
        of this call is iterated over. For instance, if max_records is set to 5,
        then iterating over the collection causes an API call to be sent to the
        server once for every 5 records. If the client stops iterating before
        getting to the 6th record, then no additional API calls are made.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `max_records`
      The maximum number of records to return per call
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  `def patch_collection (body: dict, *args, records: Iterable[ForwardRef('ConsistencyGroup')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates a consistency group.
    Note that this operation will never delete storage elements. You can specify only elements that should be added to the consistency group regardless of existing storage objects. Mapping or unmapping a consistency group from igroups or subsystems is not supported.

    ## Related ONTAP commands

    - `vserver consistency-group modify`

    ### Learn more

    - `DOC /application/consistency-groups`

    Patch all objects in a collection which match the given query.

    All records on the host which match the query will be patched with the provided body.

    ## Args

    `body`
      A dictionary of name/value pairs to set on all matching members of the collection. The body argument will be ignored if records is provided.
    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
    `records`
      Can be provided in place of a query. If so, this list of objects will be patched on the host.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def post_collection (records: Iterable[ForwardRef('ConsistencyGroup')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[ConsistencyGroup], NetAppResponse]`

    Creates a consistency group with one or more consistency groups having: * new SAN volumes, * existing SAN, NVMe or NAS FlexVol volumes in a new or existing consistency group

    ## Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the group.
    - `volumes`
    - `luns` or `namespaces`

    ## Naming Conventions

    ### Consistency groups

    - name or consistency_groups[].name, if specified
    - derived from volumes[0].name, if only one volume is specified, same as volume name

    ### Volume

    - volumes[].name, if specified
    - derived from volume prefix in luns[].name
    - derived from cg[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ### LUN

    - luns[].name, if specified
    - derived from volumes[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ### NVMe Namespace

    - namespaces[].name, if specified
    - derived from volumes[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ## Related ONTAP commands

    - `vserver consistency-group create`

    ### Learn more

    - `DOC /application/consistency-groups`

    Send this collection of objects to the host as a creation request.

    ## Args

    `records`
      A list of `Resource` objects to send to the server to be created.
    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to create a bar for a particular foo, the foo.name value should be passed.
    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of each object. When hydrate is set to True, poll must also be set to True.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

    ## Returns

    A list of `Resource` objects matching the provided type which have been created by the host and returned. This is not the same list that was provided, so to continue using the object, you should save this list. If poll is set to False, then a `NetAppResponse` object is returned instead.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Methods

  `def delete (self, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Deletes a consistency group.
    Note this will not delete any associated volumes or LUNs. To delete those elements, use the appropriate object endpoint.

    ## Related ONTAP commands

    - `vserver consistency-group delete`

    ### Learn more

    - `DOC /application/consistency-groups`

    Send a deletion request to the host for this object.

    ## Args

    `body`
      The body of the delete request. This could be a Resource instance or a dictionary object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def get (self, **kwargs) -> NetAppResponse`

    Retrieves a single consistency group.

    ### Expensive properties

    There is an added computational cost to retrieving values for these properties. They are not included by default in GET results and must be explicitly requested using the `fields` query parameter. See `DOC Requesting specific fields` to learn more. * `volumes` * `luns` * `namespaces`

    ## Related ONTAP commands

    - `vserver consistency-group show`

    ### Learn more

    - `DOC /application/consistency-groups`

    Fetch the details of the object from the host.

    Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400 or if not all of the keys required are present and config.STRICT_GET has been set to True.

  `def patch (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Updates a consistency group.
    Note that this operation will never delete storage elements. You can specify only elements that should be added to the consistency group regardless of existing storage objects. Mapping or unmapping a consistency group from igroups or subsystems is not supported.

    ## Related ONTAP commands

    - `vserver consistency-group modify`

    ### Learn more

    - `DOC /application/consistency-groups`

    Send the difference in the object's state to the host as a modification request.

    Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.

    ## Args

    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def post (self, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Creates a consistency group with one or more consistency groups having: * new SAN volumes, * existing SAN, NVMe or NAS FlexVol volumes in a new or existing consistency group

    ## Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the group.
    - `volumes`
    - `luns` or `namespaces`

    ## Naming Conventions

    ### Consistency groups

    - name or consistency_groups[].name, if specified
    - derived from volumes[0].name, if only one volume is specified, same as volume name

    ### Volume

    - volumes[].name, if specified
    - derived from volume prefix in luns[].name
    - derived from cg[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ### LUN

    - luns[].name, if specified
    - derived from volumes[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ### NVMe Namespace

    - namespaces[].name, if specified
    - derived from volumes[].name, suffixed by "_#" where "#" is a system generated unique number
    - suffixed by "_#" where "#" is a system generated unique number, if provisioning_options.count is provided

    ## Related ONTAP commands

    - `vserver consistency-group create`

    ### Learn more

    - `DOC /application/consistency-groups`

    Send this object to the host as a creation request.

    ## Args

    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Inherited members

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
    - `validate_schema`
`class ConsistencyGroupSchema (*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool | None = None, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)`

  The fields of the ConsistencyGroup object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC
  - abc.ABC

  ### Class variables

  `application: ConsistencyGroupApplication GET POST PATCH`

    The application field of the consistency_group.

  `clone: ConsistencyGroupClone GET POST PATCH`

    The clone field of the consistency_group.

  `consistency_groups: List[ConsistencyGroupChild] GET POST PATCH`

    A consistency group is a mutually exclusive aggregation of volumes or other consistency groups. A consistency group can only be associated with one direct parent consistency group.

  `links: SelfLink GET`

    The links field of the consistency_group.

  `luns: List[ConsistencyGroupLun] GET POST PATCH`

    The LUNs array can be used to create or modify LUNs in a consistency group on a new or existing volume that is a member of the consistency group. LUNs are considered members of a consistency group if they are located on a volume that is a member of the consistency group. The maximum number of items for this array is 16. The maximum number of items for this array is 256.

  `map_to: ConsistencyGroupMapTo PATCH`

    Specifies the igroup or subsystem to map the LUNs or namespaces within the consistency group. This parameter can only be used if all the storage objects within the consistency groups are either LUNs or namespaces.

  `metric: ConsistencyGroupMetrics GET`

    Performance and capacity numbers, such as, IOPS, latency, throughput, used space, and available space.

  `name: str GET POST`

    Name of the consistency group. The consistency group name must be unique within an SVM.
    If not provided and the consistency group contains only one volume, the name will be generated based on the volume name. If the consistency group contains more than one volume, the name is required.

  `namespaces: List[ConsistencyGroupConsistencyGroupsNamespaces] GET POST PATCH`

    An NVMe namespace is a collection of addressable logical blocks presented to hosts connected to the SVM using the NVMe over Fabrics protocol. In ONTAP, an NVMe namespace is located within a volume. Optionally, it can be located within a qtree in a volume.
    An NVMe namespace is created to a specified size using thin or thick provisioning as determined by the volume on which it is created. NVMe namespaces support being cloned. An NVMe namespace cannot be renamed, resized, or moved to a different volume. NVMe namespaces do not support the assignment of a QoS policy for performance management, but a QoS policy can be assigned to the volume containing the namespace. See the NVMe namespace object model to learn more about each of the properties supported by the NVMe namespace REST API.
    An NVMe namespace must be mapped to an NVMe subsystem to grant access to the subsystem's hosts. Hosts can then access the NVMe namespace and perform I/O using the NVMe over Fabrics protocol. The maximum number of items for this array is 16. The maximum number of items for this array is 256.

  `parent_consistency_group: ConsistencyGroup GET`

    The parent_consistency_group field of the consistency_group.

  `provisioning_options: ConsistencyGroupProvisioningOptions POST PATCH`

    Options that are applied to the operation.

  `qos: ConsistencyGroupQos GET POST PATCH`

    The qos field of the consistency_group.

  `replicated: bool GET`

    Indicates whether or not replication has been enabled on this consistency group.

  `replication_relationships: List[ConsistencyGroupReplicationRelationships] GET`

    Indicates the SnapMirror relationship of this consistency group.

  `replication_source: bool GET`

    Since support for this field is to be removed in the next release, use replication_relationships.is_source instead.

  `restore_to: ConsistencyGroupConsistencyGroupsRestoreTo PATCH`

    Use to restore a consistency group to a previous snapshot

  `snaplock: ConsistencyGroupSnaplock GET POST PATCH`

    The snaplock field of the consistency_group.

  `snapshot_policy: SnapshotPolicy GET POST PATCH`

    The snapshot policy of the consistency group.
    This is the dedicated consistency group snapshot policy, not an aggregation of the volume granular snapshot policy.

  `space: ConsistencyGroupSpace GET`

    The space field of the consistency_group.

  `statistics: ConsistencyGroupStatistics GET`

    These are raw performance and space numbers, such as, IOPS, latency, throughput, used space, and available space. These numbers are aggregated across all nodes in the cluster and increase with the uptime of the cluster.

  `svm: Svm GET POST`

    The svm field of the consistency_group.

  `tags: List[str] GET POST PATCH`

    Tags are an optional way to track the uses of a resource. Tag values must be formatted as key:value strings.

    Example: ["team:csi","environment:test"]

  `tiering: ConsistencyGroupTiering GET POST`

    The tiering field of the consistency_group.

  `unmap_from: ConsistencyGroupUnmapFrom PATCH`

    Specify the igroup or subsystem within the consistency group from which the LUNs or namespaces will be unmapped. This parameter can only be used if all the storage objects within the consistency groups are either LUNs or namespaces.

  `uuid: str GET`

    The unique identifier of the consistency group. The UUID is generated by ONTAP when the consistency group is created.

    Example: 1cd8a442-86d1-11e0-ae1c-123478563412

  `vdisk_type: str GET POST PATCH`

    Type of objects in the consistency group.

    Valid choices:

    - luns
    - namespaces
    - mixed
  `volumes: List[ConsistencyGroupConsistencyGroupsVolumes] GET POST PATCH`

    A consistency group is a mutually exclusive aggregation of volumes or other consistency groups. A volume can only be associated with one direct parent consistency group.
    The volumes array can be used to create new volumes in the consistency group, add existing volumes to the consistency group, or modify existing volumes that are already members of the consistency group.
    The total number of volumes across all child consistency groups contained in a consistency group is constrained by the same limit.