Beispiel #1
0
class Render(kuberun_command.KubeRunCommand, base.ExportCommand):
    """Render KubeRun application to generate the yaml resource configuration."""
    detailed_help = _DETAILED_HELP
    flags = [_OutFlag(), flags.EnvironmentFlag()]

    def Command(self):
        return ['render']
Beispiel #2
0
class GetStatus(kuberun_command.KubeRunCommand, base.ListCommand):
    """Get status of the application."""

    detailed_help = _DETAILED_HELP
    flags = [flags.EnvironmentFlag()]

    @classmethod
    def Args(cls, parser):
        super(GetStatus, cls).Args(parser)
        base.ListCommand._Flags(parser)
        base.URI_FLAG.RemoveFromParser(parser)
        status_printer.ApplicationStatusPrinter.Register(parser)

    def Command(self):
        return ['applications', 'get-status']

    def SuccessResult(self, out, args):
        if out:
            results = json.loads(out)
            for entry in results:
                entry[
                    'status'] = application_status.ApplicationStatus.FromJSON(
                        entry['status'])
            return results
        return []
Beispiel #3
0
class GetStatus(kuberun_command.KubeRunCommand, base.ListCommand):
    """Get status of the component."""

    detailed_help = _DETAILED_HELP
    flags = [flags.EnvironmentFlag()]

    @classmethod
    def Args(cls, parser):
        super(GetStatus, cls).Args(parser)
        parser.add_argument('component', help='Name of the component.')
        status_printer.ComponentStatusPrinter.Register(parser)

    def BuildKubeRunArgs(self, args):
        return [args.component] + super(GetStatus, self).BuildKubeRunArgs(args)

    def Command(self):
        return ['components', 'get-status']

    def SuccessResult(self, out, args):
        if out:
            results = json.loads(out)
            for entry in results:
                entry['status'] = component_status.ComponentStatus.FromJSON(
                    name=args.component, json_object=entry['status'])
            return results
        return []
Beispiel #4
0
class Deploy(kuberun_command.KubeRunCommand, base.CreateCommand):
    """Deploy KubeRun application."""

    detailed_help = _DETAILED_HELP
    flags = [flags.EnvironmentFlag()]

    def Command(self):
        return ['deploy']
Beispiel #5
0
class Dev(kuberun_command.KubeRunCommand, base.CreateCommand):
    """Deploy a Component in development mode."""

    detailed_help = _DETAILED_HELP
    flags = [flags.EnvironmentFlag(), _DeleteFlag()]

    @classmethod
    def Args(cls, parser):
        super(Dev, cls).Args(parser)
        parser.add_argument('component', help='Name of the component.')

    def Command(self):
        return ['components', 'dev']

    def BuildKubeRunArgs(self, args):
        return [args.component] + super(Dev, self).BuildKubeRunArgs(args)