def METHOD_NAME(resource_kind, resource, replicas, available):
    """获取资源(deployment/sts/job/ds)运行状态"""
    status = constants.ResourceStatus.Unready.value
    # 期望的数量和可用的数量都为0时，认为也是正常的
    if (available == replicas and available > 0) or (available == replicas == 0):
        status = constants.ResourceStatus.Running.value
    # 针对job添加complete状态的判断
    if resource_kind == constants.REVERSE_CATEGORY_MAP[K8sResourceName.K8sJob.value]:
        # 获取completed的replica的数量
        completed_replicas = getitems(resource, ['data', 'spec', 'completions'], default=0)
        if completed_replicas == replicas and available > 0:
            status = constants.ResourceStatus.Completed.value
    return status