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-70036: mongocli atlas integration(s) create|update WEBHOOK #419

Merged
merged 2 commits into from
Sep 8, 2020

Conversation

andreaangiolillo
Copy link
Collaborator

Proposed changes

Jira ticket: CLOUDP-70036

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

./bin/mongocli atlas integrations create WEBHOOK --url https://webhook.site/51a678a8-5c1c-4aed-83e9-93788af154e6 -o json --secret test -o json
{
  "links": [
    {
      "rel": "self",
      "href": "https://cloud-dev.mongodb.com/api/atlas/v1.0/groups/5e4e593f70dfbf1010295836/integrations/WEBHOOK?pageNum=1\u0026itemsPerPage=100"
    }
  ],
  "results": [
    {
      "type": "PAGER_DUTY",
      "serviceKey": "7fd036a6860e41469fe1fXXXXXX"
    },
    {
      "type": "DATADOG",
      "apiKey": "51c0ef87e9951c3e147acXXXXXXX",
      "region": "US"
    },
    {
      "type": "NEW_RELIC",
      "licenseKey": "eu01xx5f87268ff5028e69a67fXXXXXX",
      "accountId": "2857404",
      "writeToken": "NRII-zpwCnhrDyUojdSJOkXXXXXXX",
      "readToken": "NRIQ-MHCu7bPq2xvrrpXXXXXXXXX"
    },
    {
      "type": "OPS_GENIE",
      "apiKey": "9255b505-9c55-45a4-893c-XXXXXXXXXX",
      "region": "EU"
    },
    {
      "type": "FLOWDOCK",
      "apiToken": "c6855d4443a7e9f45b4XXXXXXXX",
      "flowName": "Main",
      "orgName": "MONGODB"
    },
    {
      "type": "WEBHOOK",
      "url": "https://webhook.site/51a678a8-5c1c-4aedXXXXXXXXXXX",
      "secret": "test"
    }
  ],
  "totalCount": 6
}
./bin/mongocli atlas integrations create WEBHOOK --url https://webhook.site/51a678a8-5c1c-4aed-83e9-93788af154e6
Webhook integration configured.

Screenshot 2020-09-08 at 09 10 08

@andreaangiolillo
Copy link
Collaborator Author

andreaangiolillo commented Sep 8, 2020

I am getting this error when trying to configure WEBHOOK without setting --secret. According to the doc, secret is optional and this seems to be true since we can configure WEBHOOK in the atlas UI without providing the secret.

I am going to create a ticket to investigate this behaviour. CLOUDP-72054

./bin/mongocli atlas integrations create WEBHOOK --url https://webhook.site/51a678a8-5c1c-4aed-83e9-93788af154e6 -o json
Error: PUT https://cloud-dev.mongodb.com/api/atlas/v1.0/groups/5e4e593f70dfbf1010295836/integrations/WEBHOOK: 400 (request "Bad Request") The provided settings for the WEBHOOK integration were invalid: Webhook Secret cannot be null.

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 7de18a3 into master Sep 8, 2020
@andreaangiolillo andreaangiolillo deleted the CLOUDP-70036 branch September 8, 2020 08:34
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.

2 participants