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

The schedule resource has been created for OpsGenie #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Old version: *v1.0*
- Opsgenie Integration


- Opsgenie Schedule



## Installation

Expand Down Expand Up @@ -61,6 +64,16 @@ aws cloudformation register-type \
```


- Opsgenie Schedule resource
```
aws cloudformation register-type \
--region us-west-2 \
--type-name "Atlassian::Opsgenie::Schedule" \
--schema-handler-package "s3://opsgeniedownloads/cloudformation/atlassian-opsgenie-schedule-v1.1.zip" \
--type RESOURCE
```


### Install using cfn-cli

- clone this repo
Expand Down
19 changes: 19 additions & 0 deletions examples/opsgenie_schedule/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Opsgenie Schedule

## Atlassian::Opsgenie::Schedule

Allows us to create schedule entities in Opsgenie via Amazon Cloudformation.<br>
To the team, you can associate schedule upon creation. <br>

## Fields

| Property | Description | Required | Limit |
|--------------------- |-------------------------------------------------------------------------------------------------|---------- |--------------------------------------- |
| OpsgenieApiKey | Your Opsgenie provided API Key | Required | |
| OpsgenieApiEndpoint | Endpoint of API according to your preferred environment | Required | api.eu.opsgenie.com, api.opsgenie.com |
| Name | Name of the schedule | Required | 100 chars |
| Description | The description of team | Optional | 10000 chars |
| Timezone | The timezone of schedule | Optional | 10000 chars |
| Enabled | This parameter is for specifying whether the schedule will be enabled or not. Defaults to true | Optional | Boolean value defaults to true. |
| OwnerTeamId | The identifier of the team associated with the integration. | Required | |
| OwnerTeamName | The name of the team associated with the integration. | Optional | | |
35 changes: 35 additions & 0 deletions examples/opsgenie_schedule/stack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Opsgenie Schedule",
"Parameters": {
"OpsgenieApiKey": {
"Description": "Enter Opsgenie Api Key",
"Type": "String"
},
"OpsgenieEndpoint": {
"Description": "Enter Opsgenie Api URL",
"Type": "String",
"Default": "https://api.opsgenie.com",
"AllowedValues": [
"https://api.opsgenie.com",
"https://api.eu.opsgenie.com",
"https://api.sandbox.opsgenie.com"
]
}
},
"Resources": {
"ScheduleTest": {
"Type": "Atlassian::Opsgenie::Schedule",
"Properties": {
"OpsgenieApiKey": {
"Ref": "OpsgenieApiKey"
},
"OpsgenieApiEndpoint": {
"Ref": "OpsgenieEndpoint"
},
"Name": "Test Schedule",
"Enabled":true
}
}
}
}
24 changes: 24 additions & 0 deletions opsgenie_schedule/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# macOS
.DS_Store
._*

# Maven outputs
.classpath

# IntelliJ
*.iml
.idea
out.java
out/
.settings
.project

# auto-generated files
target/
docs/
resource-role.yaml
.hypothesis/
.pytest_cache/

# our logs
rpdk.log
18 changes: 18 additions & 0 deletions opsgenie_schedule/.rpdk-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"artifact_type": "RESOURCE",
"typeName": "Atlassian::Opsgenie::Schedule",
"language": "java",
"runtime": "java8",
"entrypoint": "com.atlassian.opsgenie.schedule.HandlerWrapper::handleRequest",
"testEntrypoint": "com.atlassian.opsgenie.schedule.HandlerWrapper::testEntrypoint",
"settings": {
"namespace": [
"com",
"atlassian",
"opsgenie",
"schedule"
],
"protocolVersion": "2.0.0"
},
"executableEntrypoint": "com.atlassian.opsgenie.schedule.HandlerWrapperExecutable"
}
98 changes: 98 additions & 0 deletions opsgenie_schedule/atlassian-opsgenie-schedule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"typeName": "Atlassian::Opsgenie::Schedule",
"description": "Opsgenie Schedule Resource definition",
"sourceUrl": "https://github.com/opsgenie/opsgenie-cloudformation-resources",
"definitions": {
},
"properties": {
"OpsgenieApiEndpoint": {
"type": "string",
"pattern": "^https:\/\/api(\\.eu|\\.sandbox|)\\.opsgenie\\.com$",
"minLength": 1
},
"OpsgenieApiKey": {
"type": "string",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"minLength": 1
},
"ScheduleId": {
"type": "string",
"pattern": "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"
},
"Enabled": {
"type": "boolean",
"description": "Schedule status, default is true",
"minLength": 1
},
"Name": {
"type": "string",
"pattern": "^[a-zA-Z0-9- _.]+$",
"description": "Integration name",
"minLength": 1
},
"Description": {
"type": "string",
"description": "Schedule description",
"minLength": 1
},
"OwnerTeamId": {
"type": "string",
"description": "Id of the schedule owner team.",
"minLength": 1
},
"OwnerTeamName": {
"type": "string",
"pattern": "^[a-zA-Z0-9-_.]+$",
"description": "Name of the schedule owner team.",
"minLength": 1
},
"Timezone": {
"type": "string",
"description": "Schedule timezone",
"minLength": 1
}
},
"required": [
"OpsgenieApiEndpoint",
"OpsgenieApiKey",
"Name"
],
"primaryIdentifier": [
"/properties/ScheduleId"
],
"readOnlyProperties": [
"/properties/ScheduleId"
],
"writeOnlyProperties": [
"/properties/OwnerTeamId"
],
"handlers": {
"create": {
"permissions": [
""
]
},
"read": {
"permissions": [
""
]
},
"update": {
"permissions": [
""
]
},
"delete": {
"permissions": [
""
]
},
"list": {
"permissions": [
""
]
}
},
"additionalProperties": false
}

Loading