Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDP-73752: mongocli ops-manager serverUsage project(s) hosts lists|ls, CLOUDP-73755: mongocli ops-manager serverUsage org(s) hosts lists|ls #500

Merged
merged 4 commits into from
Oct 16, 2020

Conversation

andreaangiolillo
Copy link
Collaborator

Proposed changes

Jira ticket: CLOUDP-73752
Jira ticket: CLOUDP-73755

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

ORG

./bin/mongocli om serverUsage organization hosts list --startDate "2020-01-01" --endDate "2020-10-16" -P ops
HOSTNAME                                           SERVER TYPE         MEM SIZE MB   CHARGEABLE
virtual.host.pxffdisdcrrgefpr.internal.mongodb-1   TEST_SERVER         250           true
virtual.host.pxffdisdcrrgefpr.internal.mongodb-0   PRODUCTION_SERVER   250           true
virtual.host.pxffdisdcrrgefpr.internal.mongodb-2   PRODUCTION_SERVER   250           true
./bin/mongocli om serverUsage organization hosts list --startDate "2020-01-01" --endDate "2020-10-16" -P ops -o json
{
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/api/public/v1.0/usage/groups/5f8890a2cd05bb6fc011c443/hosts?endDate=2020-10-16\u0026startDate=2020-01-01\u0026pageNum=1\u0026itemsPerPage=100"
    }
  ],
  "results": [
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-1",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        }
      ],
      "serverType": {
        "name": "TEST_SERVER",
        "label": "Test/QA Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    },
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-0",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        }
      ],
      "serverType": {
        "name": "PRODUCTION_SERVER",
        "label": "Production Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    },
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-2",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        }
      ],
      "serverType": {
        "name": "PRODUCTION_SERVER",
        "label": "Production Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    }
  ],
  "totalCount": 3
}

PROJ

./bin/mongocli om serverUsage project hosts list --startDate "2020-01-01" --endDate "2020-10-16" -P ops
HOSTNAME                                           SERVER TYPE         MEM SIZE MB   CHARGEABLE
virtual.host.pxffdisdcrrgefpr.internal.mongodb-1   TEST_SERVER         250           true
virtual.host.pxffdisdcrrgefpr.internal.mongodb-0   PRODUCTION_SERVER   250           true
virtual.host.pxffdisdcrrgefpr.internal.mongodb-2   PRODUCTION_SERVER   250           true
./bin/mongocli om serverUsage project hosts list --startDate "2020-01-01" --endDate "2020-10-16" -P ops -o json
{
  "links": [
    {
      "rel": "self",
      "href": "http://localhost:8080/api/public/v1.0/usage/groups/5f8890a2cd05bb6fc011c443/hosts?endDate=2020-10-16\u0026startDate=2020-01-01\u0026pageNum=1\u0026itemsPerPage=100"
    }
  ],
  "results": [
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-1",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        }
      ],
      "serverType": {
        "name": "TEST_SERVER",
        "label": "Test/QA Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    },
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-0",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaPrimary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 7
        }
      ],
      "serverType": {
        "name": "PRODUCTION_SERVER",
        "label": "Production Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    },
    {
      "hostname": "virtual.host.pxffdisdcrrgefpr.internal.mongodb-2",
      "processes": [
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc1-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc2-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        },
        {
          "cluster": "labcvygm",
          "groupName": "Project 0",
          "orgName": "Organization 0",
          "groupId": "5f8890a2cd05bb6fc011c443",
          "name": "replicaSecondary-0-proc0-run35645",
          "hasConflictingServerType": true,
          "processType": 8
        }
      ],
      "serverType": {
        "name": "PRODUCTION_SERVER",
        "label": "Production Server"
      },
      "memSizeMB": 250,
      "isChargeable": true
    }
  ],
  "totalCount": 3
}

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small nit

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreaangiolillo andreaangiolillo merged commit 0f0a220 into master Oct 16, 2020
@andreaangiolillo andreaangiolillo deleted the CLOUDP-73752 branch October 16, 2020 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants