-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from nutanix/release/3.3.0
Changes for Calm v3.3.0
- Loading branch information
Showing
110 changed files
with
8,827 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from .resource import ResourceAPI | ||
|
||
|
||
class AppProtectionPolicyAPI(ResourceAPI): | ||
def __init__(self, connection): | ||
super().__init__( | ||
connection, resource_type="app_protection_policies", calm_api=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .resource import ResourceAPI | ||
|
||
|
||
class TaskAPI(ResourceAPI): | ||
def __init__(self, connection): | ||
super().__init__(connection, resource_type="tasks") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .resource import ResourceAPI | ||
|
||
|
||
class VmRecoveryPointAPI(ResourceAPI): | ||
def __init__(self, connection): | ||
super().__init__(connection, resource_type="nutanix/v1/vm_recovery_points") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import sys | ||
import uuid | ||
|
||
from .entity import Entity, EntityType | ||
from .validator import PropertyValidator | ||
from .helper import common as common_helper | ||
from .ahv_vm import AhvVmResourcesType | ||
|
||
from calm.dsl.store import Cache | ||
from calm.dsl.constants import CACHE | ||
from calm.dsl.api.handle import get_api_client | ||
from calm.dsl.log import get_logging_handle | ||
|
||
|
||
LOG = get_logging_handle(__name__) | ||
|
||
|
||
# AhvRecoveryVm | ||
|
||
|
||
class AhvVMRecoveryResourcesType(AhvVmResourcesType): | ||
"""Metaclass for ahv vm recovery resources""" | ||
|
||
__schema_name__ = "AhvVmRecoveryResources" | ||
__openapi_type__ = "recovery_vm_ahv_resources" | ||
|
||
|
||
class AhvVMRecoveryResourcesValidator( | ||
PropertyValidator, openapi_type="recovery_vm_ahv_resources" | ||
): | ||
__default__ = None | ||
__kind__ = AhvVMRecoveryResourcesType | ||
|
||
|
||
def _ahv_vm_recovery_resources(**kwargs): | ||
name = kwargs.get("name", None) | ||
bases = (Entity,) | ||
return AhvVMRecoveryResourcesType(name, bases, kwargs) | ||
|
||
|
||
AhvVmRecoveryResources = _ahv_vm_recovery_resources() | ||
|
||
|
||
# AhvVmRecoverySpec | ||
|
||
|
||
class AhvVMRecoverySpecType(EntityType): | ||
"""Metaclass for ahv vm recovery resources""" | ||
|
||
__schema_name__ = "AhvVmRecoverySpec" | ||
__openapi_type__ = "recovery_vm_ahv_spec" | ||
|
||
|
||
class AhvVMRecoverySpecValidator( | ||
PropertyValidator, openapi_type="recovery_vm_ahv_spec" | ||
): | ||
__default__ = None | ||
__kind__ = AhvVMRecoverySpecType | ||
|
||
|
||
def ahv_vm_recovery_spec(**kwargs): | ||
name = kwargs.get("name", None) | ||
bases = (Entity,) | ||
return AhvVMRecoverySpecType(name, bases, kwargs) | ||
|
||
|
||
AhvVMRecoverySpec = ahv_vm_recovery_spec() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import sys | ||
|
||
from calm.dsl.log import get_logging_handle | ||
|
||
from .config_spec import patch_config_create | ||
|
||
LOG = get_logging_handle(__name__) | ||
|
||
|
||
class AppEdit: | ||
def __new__(cls, *args, **kwargs): | ||
raise TypeError("'{}' is not callable".format(cls.__name__)) | ||
|
||
class UpdateConfig: | ||
def __new__( | ||
cls, | ||
name, | ||
target, | ||
patch_attrs, | ||
): | ||
if target.__self__.substrate.__self__.provider_type != "AHV_VM": | ||
LOG.error( | ||
"Config is not supported for {} provider. Please try again after changing the provider".format( | ||
target.__self__.substrate.__self__.provider_type | ||
) | ||
) | ||
return patch_config_create( | ||
name, | ||
target=target, | ||
patch_attrs=patch_attrs, | ||
) |
Oops, something went wrong.