Documentation Home

API Documentation

Introduction

Status App provides a REST API that can be used by applications to query Status App to retrieve notifications or update the client status.

Services

Method URL Template Description
GET /api/v1/notifications Retrieves list of notifications
GET /api/v1/statuses Retrieves list of the applications statuses
GET /api/v1/version Retrieves api version
POST update_application_status Updates Client application or Service status to manage Client DSE notifications

/api/v1/notifications

▲ Top

Allowed Methods

GET

Description

Return list of all notifications

Parameters

client: Optionally takes in client, and returns only those notifications that are applicable to given client
domain: Optionally takes in domain, overrides 'client' if both specified and returns only those notifications that are applicable to given domain.
all: Optionally takes in all=true, and returns all notifications, if this flag is set to false or none is sent, the default behaviour returns current notifications

Response

Notes Request Response
Retrieve all notifications

{
curl --request GET \
  --url 'https://status.earthdata.nasa.gov/api/v1/notifications'
}

Status Code: 200
    
        {
          "success": true,
    "notifications": [
        {
            "id": 485,
            "notification_type": "message",
            "message": "Test trusted partners",
            "updated_at": "2018-02-27T10:19:49.409-05:00",
            "created_at": "2018-02-27T10:19:49.409-05:00",
            "starttime": null,
            "endtime": null,
            "applications": [
                "Common Metadata Repository (SIT)"
            ],
            "domains": [
                "https://cmr.sit.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": ""
        },
        {
            "id": 525,
            "notification_type": "message",
            "message": "NASA is eliminating the use of the FTP protocol for any external"
            "updated_at": "2018-05-23T13:40:55.141-04:00",
            "created_at": "2018-04-16T08:13:21.738-04:00",
            "starttime": "2018-04-16T08:08:00.000-04:00",
            "endtime": null,
            "applications": [
                "Earthdata Search",
                "Earthdata Search (SIT)",
                "Earthdata Search (UAT)"
            ],
            "domains": [
                "https://search.earthdata.nasa.gov",
                "https://search.sit.earthdata.nasa.gov",
                "https://search.uat.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": ""
        }
      ]
}   }
    
All notifications are retrieved
  
{
curl --request GET \
  --url 'https://status.earthdata.nasa.gov/api/v1/notifications?all=true' 
}

Status Code: 200
                
    
    {
    "success": true,
    "notifications": [
        {
            "id": 480,
            "notification_type": "alert",
            "message": "This is a test alert for GCMD-UAT Qaviewer tool",
            "updated_at": "2018-02-21T11:11:02.207-05:00",
            "created_at": "2018-02-21T11:11:02.207-05:00",
            "starttime": "2018-02-21T11:00:00.000-05:00",
            "endtime": "2018-02-21T12:00:00.000-05:00",
            "applications": [
                "KMS (UAT)"
            ],
            "domains": [
                "https://gcmd.uat.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": "/qaviewer/"
        },
        {
            "id": 482,
            "notification_type": "message",
            "message": "GCMD has implemented a new notification system." 
            "updated_at": "2018-02-26T10:32:35.950-05:00",
            "created_at": "2018-02-26T10:32:35.950-05:00",
            "starttime": "2018-02-26T10:30:00.000-05:00",
            "endtime": "2018-02-26T11:00:00.000-05:00",
            "applications": [],
            "domains": [],
            "dismissible": true,
            "path": ""
        }
      ]
    }
    
Retrieve all notifications for a specific client

{
curl --request GET \
  --url 'https://status.earthdata.nasa.gov/api/v1/notifications?client=Common%20Metadata%20Repository%20(SIT)&alll=true' 
}

Status Code: 200
    
    {
    "success": true,
    "notifications": [
        {
            "id": 485,
            "notification_type": "message",
            "message": "Test trusted partners",
            "updated_at": "2018-02-27T10:19:49.409-05:00",
            "created_at": "2018-02-27T10:19:49.409-05:00",
            "starttime": null,
            "endtime": null,
            "applications": [
                "Common Metadata Repository (SIT)"
            ],
            "domains": [
                "https://cmr.sit.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": ""
        },
        {
            "id": 1464,
            "notification_type": "message",
            "message": "Starting January 1, 2022, all CMR providers should be fully"
            "updated_at": "2021-10-20T16:50:19.160-04:00",
            "created_at": "2021-10-20T16:44:42.519-04:00",
            "starttime": "2021-10-20T16:38:00.000-04:00",
            "endtime": null,
            "applications": [
                "Common Metadata Repository (SIT)",
                "Common Metadata Repository (UAT)",
                "Common Metadata Repository (PROD)"
            ],
            "domains": [
                "https://cmr.sit.earthdata.nasa.gov",
                "https://cmr.uat.earthdata.nasa.gov",
                "https://cmr.earthdata.nasa.gov"
            ],
            "dismissible": false,
            "path": ""
        }
    ]
}
    
Retrieve all notifications for a specific domain

{
curl --request GET \
  --url 'https://status.earthdata.nasa.gov/api/v1/notifications?domain=https%3A%2F%2Furs.earthdata.nasa.gov&all=true'
}

Status Code: 200
    
        {
          {
    "success": true,
    "notifications": [
        {
            "id": 456,
            "notification_type": "outage",
            "message": "This site will be unavailable for a brief (~ 1 to 5 min)"
            "updated_at": "2018-01-17T17:00:32.502-05:00",
            "created_at": "2018-01-17T17:00:32.502-05:00",
            "starttime": "2018-01-17T16:57:00.000-05:00",
            "endtime": "2018-01-18T12:00:00.000-05:00",
            "applications": [
                "Earthdata Login"
            ],
            "domains": [
                "https://urs.earthdata.nasa.gov",
                "https://bugs.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": ""
        },
        {
            "id": 396,
            "notification_type": "alert",
            "message": "We are currently experiencing problems with our automated"
            "updated_at": "2017-10-03T21:38:28.664-04:00",
            "created_at": "2017-10-02T22:14:42.909-04:00",
            "starttime": "2017-10-02T22:11:00.000-04:00",
            "endtime": "2017-10-04T22:11:00.000-04:00",
            "applications": [
                "Earthdata Login"
            ],
            "domains": [
                "https://urs.earthdata.nasa.gov"
            ],
            "dismissible": true,
            "path": ""
        },
      ]
}   }
    

/api/v1/statuses

▲ Top

Allowed Methods

GET

Description

Returns the applications statuses as a String. Result will be one of 4 statuses: "OK", "ISSUE", "OUTAGE", or "MAINTENANCE". Applications with status of "UNKNOWN" will not be shown.

Parameters

None

Response

Notes Request Response
Retrieve application statuses

{
curl --request GET \
--url https://localhost:3000/api/v1/statuses \
}

Status Code: 200
    
{
    "success": true,
    "statuses": [
        {
            "name": "Earthdata Login",
            "status": "OK"
        },
        {
            "name": "Earthdata Search (UAT)",
            "status": "ISSUE"
        },
        {
            "name": "Common Metadata Repository (SIT)",
            "status": "OK"
        }
    ]
}
    

/api/v1/version

▲ Top

Allowed Methods

GET

Description

Returns the api version as a String

Parameters

None

Response

Notes Request Response
Retrieve Version of the API

{
curl --request GET \
--url https://localhost:3000/api/v1/version \
}

Status Code: 200
    
{
    "version": "v1"
}
    

/update_application_status

▲ Top

Allowed Methods

POST

Description

Client applications statuses can be updated through an API to allow for automated status updates.
To use this API, you must be an application admin with an API key and a status message.
Optionally, you can also set the status of a service in your application as long as you have a status message configured for that service.

API Key is passed in Authorization header as Bearer header('Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356ba')

Parameters

key: Key of status message to update to. - Required
service_key: Key of the service to be updated.
email_notify: Boolean flag to send an email notification. Optional, defaults to false.

Response

Depending upon the client api key validity, the result will be a JSON formatted response.

Notes Request Response
Invalid API Key

{
curl --request GET \
--url 'https://localhost:3000/update_application_status?key=OK' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 401
Valid API key, updating application status

{
curl --request POST \
  --url 'https://localhost:3000/update_application_status?key=OK' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 200
    
    {
        "msg": "Application_Name> status updated to OK"
    }

Valid API key, updating application status and notifying configured email addresses about status update

{
curl --request POST \
  --url 'https://localhost:3000/update_application_status?key=OK&email_notify=true' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 200
    
    {
        "msg": "Application_Name> status updated to OK"
    }

Valid API key, updating status of a service configured for the application

{
curl --request POST \
  --url 'http://localhost:3000/update_application_status?key=OK&service_key=exampleService' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 200
    
   {
    "msg": "SERVICE_NAME> status updated to OK"
   }
    

Valid API key, updating status of a service configured for the application ane notifying the configured email

{
curl --request POST \
  --url 'http://localhost:3000/update_application_status?key=OK&service_key=exampleService&email_nootify=true' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 200
    
   {
    "msg": "SERVICE_NAME> status updated to OK"
   }
    

Valid API key, updating status of a service to a non existent service status key

{
curl --request POST \
  --url 'http://localhost:3000/update_application_status?key=INVALIDKEY&service_key=exampleService' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 400
    
   {
    "error": "Invalid Key"
   }
    

Valid API key, updating status of a service to the same status

{
curl --request POST \
  --url 'http://localhost:3000/update_application_status?key=SAMEKEY&service_key=exampleService' \
  --header 'Authorization: Bearer d51033ee-70d0-47c0-b893-ca4356b86a4a'
}

Status Code: 400
    
   {
    "error": "Service status is already SERVICEISSUE"
   }