def get_payload_for_node_create(params): """Construct telemetry payload of node create. :param params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.NODE_CREATE.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(params.get(PayloadKey.CLUSTER_ID)), PayloadKey.TEMPLATE_NAME: params.get(RequestKey.TEMPLATE_NAME), PayloadKey.TEMPLATE_REVISION: params.get(RequestKey.TEMPLATE_REVISION), PayloadKey.K8S_DISTRIBUTION: params.get(LocalTemplateKey.KUBERNETES), PayloadKey.K8S_VERSION: params.get(LocalTemplateKey.KUBERNETES_VERSION), # noqa: E501 PayloadKey.CNI_VERSION: params.get(LocalTemplateKey.CNI_VERSION), PayloadKey.CNI: params.get(LocalTemplateKey.CNI), PayloadKey.OS: params.get(LocalTemplateKey.OS), PayloadKey.NUMBER_OF_NODES: params.get(RequestKey.NUM_WORKERS), PayloadKey.NODE_TYPE: PayloadValue.WORKER, PayloadKey.CPU: params.get(LocalTemplateKey.CPU), PayloadKey.MEMORY: params.get(LocalTemplateKey.MEMORY), PayloadKey.WAS_STORAGE_PROFILE_SPECIFIED: bool(params.get(RequestKey.STORAGE_PROFILE_NAME)), # noqa: E501 PayloadKey.WAS_SSH_KEY_SPECIFIED: bool(params.get(RequestKey.SSH_KEY)), PayloadKey.WAS_NFS_ENABLED: bool(params.get(RequestKey.ENABLE_NFS)), PayloadKey.WAS_ROLLBACK_ENABLED: bool(params.get(RequestKey.ROLLBACK)), PayloadKey.WAS_OVDC_SPECIFIED: bool(params.get(RequestKey.OVDC_NAME)), PayloadKey.WAS_ORG_SPECIFIED: bool(params.get(RequestKey.ORG_NAME)) }
def get_payload_for_v35_cluster_apply(def_entity: DefEntity): """Construct telemetry payload of v35 cluster apply. :param DefEntity def_entity: defined entity instance :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.V35_CLUSTER_APPLY.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(pyvcd_utils.extract_id(def_entity.id)), # noqa: E501 PayloadKey.CLUSTER_KIND: def_entity.entity.kind, PayloadKey.TEMPLATE_NAME: def_entity.entity.spec.k8_distribution.template_name, # noqa: E501 PayloadKey.TEMPLATE_REVISION: def_entity.entity.spec.k8_distribution.template_revision, # noqa: E501 PayloadKey.NUMBER_OF_MASTER_NODES: def_entity.entity.spec.control_plane.count, # noqa: E501 PayloadKey.NUMBER_OF_WORKER_NODES: def_entity.entity.spec.workers.count, # noqa: E501 PayloadKey.NUMBER_OF_NFS_NODES: def_entity.entity.spec.nfs.count, # noqa: E501 PayloadKey.WAS_SSH_KEY_SPECIFIED: bool(def_entity.entity.spec.settings.ssh_key), # noqa: E501 PayloadKey.WAS_ROLLBACK_ENABLED: bool(def_entity.entity.spec.settings.rollback_on_failure) # noqa: E501 }
def get_payload_for_cluster_upgrade_plan(params): """Construct telemetry payload of cluster upgrade plan. :param params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.CLUSTER_UPGRADE_PLAN.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(params.get(PayloadKey.CLUSTER_ID)), PayloadKey.WAS_OVDC_SPECIFIED: bool(params.get(RequestKey.OVDC_NAME)), PayloadKey.WAS_ORG_SPECIFIED: bool(params.get(RequestKey.ORG_NAME)) }
def get_payload_for_v35_cluster_upgrade_plan(def_entity: DefEntity): """Construct telemetry payload of v35 cluster upgrade plan. :param DefEntity def_entity: defined entity instance :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.V35_CLUSTER_UPGRADE_PLAN.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(pyvcd_utils.extract_id(def_entity.id)), # noqa: E501 PayloadKey.CLUSTER_KIND: def_entity.entity.kind }
def get_payload_for_node_info(params): """Construct telemetry payload of node info. :param params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.NODE_INFO.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(params.get(PayloadKey.CLUSTER_ID)), PayloadKey.NODE_NAME: params.get(RequestKey.NODE_NAME), PayloadKey.WAS_OVDC_SPECIFIED: bool(params.get(RequestKey.OVDC_NAME)), PayloadKey.WAS_ORG_SPECIFIED: bool(params.get(RequestKey.ORG_NAME)) }
def get_payload_for_v35_cluster_info(params): """Construct telemetry payload of v35 cluster info. :param dict params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.V35_CLUSTER_INFO.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(pyvcd_utils.extract_id(params.get( PayloadKey.CLUSTER_ID))) # noqa: E501 }
def get_payload_for_cluster_config(params): """Construct telemetry payload of cluster config. :param params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.CLUSTER_CONFIG.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(params.get(PayloadKey.CLUSTER_ID)), PayloadKey.TEMPLATE_NAME: params.get(RequestKey.TEMPLATE_NAME), PayloadKey.TEMPLATE_REVISION: params.get(RequestKey.TEMPLATE_REVISION), PayloadKey.WAS_OVDC_SPECIFIED: bool(params.get(RequestKey.OVDC_NAME)), PayloadKey.WAS_ORG_SPECIFIED: bool(params.get(RequestKey.ORG_NAME)) }
def get_payload_for_cluster_resize(params): """Construct telemetry payload of cluster resize. :param params: parameters provided to the operation :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.CLUSTER_RESIZE.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(params.get(PayloadKey.CLUSTER_ID)), PayloadKey.NUMBER_OF_WORKER_NODES: params.get(RequestKey.NUM_WORKERS), PayloadKey.TEMPLATE_NAME: params.get(RequestKey.TEMPLATE_NAME), PayloadKey.TEMPLATE_REVISION: params.get(RequestKey.TEMPLATE_REVISION), PayloadKey.WAS_ROLLBACK_ENABLED: bool(params.get(RequestKey.ROLLBACK)), PayloadKey.WAS_OVDC_SPECIFIED: bool(params.get(RequestKey.OVDC_NAME)), PayloadKey.WAS_ORG_SPECIFIED: bool(params.get(RequestKey.ORG_NAME)) }
def get_payload_for_v35_cluster_upgrade(def_entity: DefEntity): """Construct telemetry payload of v35 cluster upgrade. :param DefEntity def_entity: defined entity instance :return: json telemetry data for the operation :type: dict """ return { PayloadKey.TYPE: CseOperation.V35_CLUSTER_UPGRADE.telemetry_table, PayloadKey.CLUSTER_ID: uuid_hash(pyvcd_utils.extract_id(def_entity.id)), # noqa: E501 PayloadKey.CLUSTER_KIND: def_entity.entity.kind, PayloadKey.TEMPLATE_NAME: def_entity.entity.spec.k8_distribution.template_name, # noqa: E501 PayloadKey.TEMPLATE_REVISION: def_entity.entity.spec.k8_distribution.template_revision # noqa: E501 }