Code Monkey home page Code Monkey logo

Comments (3)

krutaw avatar krutaw commented on September 7, 2024 1

Okay, so I finally figured this out and I'm going to leave behind how I actually resolved this on my own for "the next guy". ;)

Here's the exact curl that I used to create an incident in OpenDuty:

curl --insecure -H "Content-type: application/json" -H "Authorization: token thisismysecret" -X POST -d '{"service_key":"b893c504c51c26c720056ed94ec53049b9b9d0a4","event_type":"trigger","description":"test","incident_key":"1234567","details":"Details here"}' http://192.168.0.92:9080/api/create_event

Now, just to break this down, here's where each bit comes from:

"Authorization: token thisismysecret" comes from the settings file, specifically, I have this set in my openduty.settings_dev file:

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'thisismysecret'

The "service_key" comes from first creating a service, and then creating an API key for the service. In this case, I named my service "Nagios" which had a "Service ID" of "84b689a038614539ad37582519de207e" and I then created the API Key by the name of "nagios_api_key" that ended up being "b893c504c51c26c720056ed94ec53049b9b9d0a4".

Hope this helps someone and that I wasn't just being dense. :)

from openduty.

gabrielfsousa avatar gabrielfsousa commented on September 7, 2024

we have to create first the service ? :(

from openduty.

krutaw avatar krutaw commented on September 7, 2024

@gabrielfsousa Yes, you have to create the Schedule, Escalation policy, Service and the API Key in order to be able to send via the API.

from openduty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.