Skip to content

shellfoundry health check needs updates #26

@ericrqs

Description

@ericrqs

This is what you get today:

def health_check(self, cancellation_context):
    """
    Checks if the device is up and connectable
    :return: None
    :exception Exception: Raises an error if cannot connect
    """
  1. The context parameter is missing
  2. The return value should be "Health check on resource ___ passed." and not None
  3. The template should include sample code for setting the live status which is part of the standard:

from cloudshell.api.cloudshell_api import CloudShellAPISession

    api = CloudShellAPISession(context.connectivity.server_address,
                               token_id=context.connectivity.admin_auth_token,
                               port=context.connectivity.cloudshell_api_port)

    rv = 'Health check on resource %s passed' % context.resource.fullname
    api.SetResourceLiveStatus(context.resource.fullname,  'Online', rv)
    return rv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions