-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4fffb5d
commit e44cde8
Showing
4 changed files
with
76 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
"""Provisioning for deployed Data Safe Haven infrastructure.""" | ||
|
||
from .shm_provisioning_manager import SHMProvisioningManager | ||
# from .shm_provisioning_manager import SHMProvisioningManager | ||
from .sre_provisioning_manager import SREProvisioningManager | ||
|
||
__all__ = [ | ||
"SHMProvisioningManager", | ||
# "SHMProvisioningManager", | ||
"SREProvisioningManager", | ||
] |
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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
"""Provisioning manager for a deployed SHM.""" | ||
# """Provisioning manager for a deployed SHM.""" | ||
|
||
from data_safe_haven.external import AzureApi | ||
from data_safe_haven.infrastructure import SHMStackManager | ||
# from data_safe_haven.external import AzureApi | ||
# from data_safe_haven.infrastructure import SHMStackManager | ||
|
||
|
||
class SHMProvisioningManager: | ||
"""Provisioning manager for a deployed SHM.""" | ||
# class SHMProvisioningManager: | ||
# """Provisioning manager for a deployed SHM.""" | ||
|
||
def __init__( | ||
self, | ||
subscription_name: str, | ||
stack: SHMStackManager, | ||
): | ||
super().__init__() | ||
self.subscription_name = subscription_name | ||
domain_controllers_resource_group_name = stack.output("domain_controllers")[ | ||
"resource_group_name" | ||
] | ||
domain_controllers_vm_name = stack.output("domain_controllers")["vm_name"] | ||
# def __init__( | ||
# self, | ||
# subscription_name: str, | ||
# stack: SHMStackManager, | ||
# ): | ||
# super().__init__() | ||
# self.subscription_name = subscription_name | ||
# domain_controllers_resource_group_name = stack.output("domain_controllers")[ | ||
# "resource_group_name" | ||
# ] | ||
# domain_controllers_vm_name = stack.output("domain_controllers")["vm_name"] | ||
|
||
# Construct DC restart parameters | ||
self.dc_restart_params = { | ||
"resource_group_name": domain_controllers_resource_group_name, | ||
"vm_name": domain_controllers_vm_name, | ||
} | ||
# # Construct DC restart parameters | ||
# self.dc_restart_params = { | ||
# "resource_group_name": domain_controllers_resource_group_name, | ||
# "vm_name": domain_controllers_vm_name, | ||
# } | ||
|
||
def restart_domain_controllers(self) -> None: | ||
azure_api = AzureApi(self.subscription_name) | ||
azure_api.restart_virtual_machine( | ||
self.dc_restart_params["resource_group_name"], | ||
self.dc_restart_params["vm_name"], | ||
) | ||
# def restart_domain_controllers(self) -> None: | ||
# azure_api = AzureApi(self.subscription_name) | ||
# azure_api.restart_virtual_machine( | ||
# self.dc_restart_params["resource_group_name"], | ||
# self.dc_restart_params["vm_name"], | ||
# ) | ||
|
||
def run(self) -> None: | ||
"""Apply SHM configuration""" | ||
self.restart_domain_controllers() | ||
# def run(self) -> None: | ||
# """Apply SHM configuration""" | ||
# self.restart_domain_controllers() |