generated from QualiSystems/cloudshell-package-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added name_generator. Added flows. Added Instance and InstanceHandler
- Loading branch information
Showing
6 changed files
with
537 additions
and
241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from cloudshell.cp.gcp.handlers.instance import Instance | ||
from cloudshell.cp.gcp.flows.deploy_instance.base_flow import AbstractGCPDeployFlow | ||
|
||
if TYPE_CHECKING: | ||
from cloudshell.cp.gcp.models.deploy_app import InstanceFromMachineImageDeployApp | ||
|
||
|
||
class GCPDeployInstanceFromImageFlow(AbstractGCPDeployFlow): | ||
def _create_instance( | ||
self, | ||
deploy_app: InstanceFromMachineImageDeployApp, | ||
) -> Instance: | ||
"""Create Instance object based on Machine Image.""" | ||
return Instance( | ||
deploy_app=deploy_app, | ||
resource_config=self.resource_config | ||
).from_machine_image() |
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,21 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from cloudshell.cp.gcp.handlers.instance import Instance | ||
from cloudshell.cp.gcp.flows.deploy_instance.base_flow import AbstractGCPDeployFlow | ||
|
||
if TYPE_CHECKING: | ||
from cloudshell.cp.gcp.models.deploy_app import InstanceFromScratchDeployApp | ||
|
||
|
||
class GCPDeployInstanceFromScratchFlow(AbstractGCPDeployFlow): | ||
def _create_instance( | ||
self, | ||
deploy_app: InstanceFromScratchDeployApp, | ||
) -> Instance: | ||
"""Create Instance object based on provided attributes.""" | ||
return Instance( | ||
deploy_app=deploy_app, | ||
resource_config=self.resource_config | ||
).from_scratch() |
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,21 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from cloudshell.cp.gcp.handlers.instance import Instance | ||
from cloudshell.cp.gcp.flows.deploy_instance.base_flow import AbstractGCPDeployFlow | ||
|
||
if TYPE_CHECKING: | ||
from cloudshell.cp.gcp.models.deploy_app import InstanceFromTemplateDeployApp | ||
|
||
|
||
class GCPDeployInstanceFromTemplateFlow(AbstractGCPDeployFlow): | ||
def _create_instance( | ||
self, | ||
deploy_app: InstanceFromTemplateDeployApp, | ||
) -> Instance: | ||
"""Create Instance object based on Template.""" | ||
return Instance( | ||
deploy_app=deploy_app, | ||
resource_config=self.resource_config | ||
).from_template() |
Oops, something went wrong.