Code Monkey home page Code Monkey logo

opsgenie's Introduction

Opsgenie Migration Tool

Opsgenie

Opsgenie Migration Tool helps you to migrate your data from one Opsgenie account to another. It is a CLI tool that uses the Opsgenie REST API to export data from the source account and import it into the target account.


Table of Contents


About Opsgenie

Opsgenie is a modern incident management platform for operating always-on services, empowering Dev & Ops teams to plan for service disruptions and stay in control during incidents. With over 200 deep integrations and a highly flexible rules engine, Opsgenie centralizes alerts, notifies the right people reliably, and enables them to take rapid action. Throughout the incident lifecycle, Opsgenie tracks all activity and provides actionable insights to improve productivity and drive continuous operational efficiencies.

Opsgenie is a Atlassian product. Atlassian is a leading provider of team collaboration and productivity software and the maker of Jira, Confluence, Bitbucket, and Trello products.


You can use this tool to migrate the following data:

  • Teams
  • Users
  • Schedules
  • Custom Roles
  • Escalations
  • Policies
  • Integrations
  • Rotation Schedules

Prerequisites

  • Python 3.12 or later
  • An API key for the source Opsgenie account
  • An API key for the target Opsgenie account

Installation

  1. Clone the repository

  2. Create a .env file in the root directory

  3. Add the following variables to the .env file

    # Source Opsgenie API Key
    SOURCE_API_KEY=""
    # Destination Opsgenie API Key
    DESTINATION_API_KEY=""
    # Source Opsgenie API URL
    BASE_URL="https://api.eu.opsgenie.com"

Python Virtual Environment

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Python Requirements

  • requests
  • python-dotenv
  • termcolor

๐Ÿ”


Python Usage

python main.py --color

๐Ÿ”


Known Limitations

  • Slack integration can't be migrated using API

๐Ÿ”


Flowchart | Opsgenie API Migration

graph LR
    A[Start] -- GET --> B[List all teams in source]
    A -- GET --> C[List all teams in destination]
    A --> D[Ask which team to migrate]
    D -- Q --> T[Exit]
    D --> X[Check if team exists in destination]
    X -- Yes --> Y[Ask if team should be updated]
    Y --> E[Get team data from source]
    Y --> Z[Get team data from destination]
    Z --> AA[Compare team data]
    AA -- PATCH --> BB[Update team]
    BB --> S[Again?]
    X -- No --> E[Get team data from source]
    D -- GET --> E[Get team data from source]
    E --> F[Team payload]
    E --> H[Schedule]
    E --> G[Custom Role]
    E --> I[Integrations]
    E --> J[Escalations]
    F -- POST --> M[Team migration]
    H -- POST --> N[Schedule migration]
    G -- POST --> O[Custom Role migration]
    I -- POST --> P[Integration migration]
    J -- POST --> Q[Escalation migration]
    M --> S[Again?]
    N --> S[Again?]
    O --> S[Again?]
    P --> S[Again?]
    Q --> S[Again?]
    S -- No --> T[Exit]
    S -- Yes --> A[Start]
Loading

๐Ÿ”


opsgenie's People

Contributors

alexroman777 avatar

Watchers

 avatar

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.