Skip to content

Instantly share code, notes, and snippets.

@brycejohnston
Last active January 21, 2018 23:14
Show Gist options
  • Save brycejohnston/85b42ea6c0ad4d27655c8103ccc2c57d to your computer and use it in GitHub Desktop.
Save brycejohnston/85b42ea6c0ad4d27655c8103ccc2c57d to your computer and use it in GitHub Desktop.
sentinel-2 SNS example
{
"name" : "S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435",
"id" : "91b49eb5-735f-4043-aff1-bb67f6d51db7",
"path" : "products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435",
"timestamp" : "2018-01-21T14:15:01.026Z",
"datatakeIdentifier" : "GS2A_20180121T141501_013492_N02.06",
"sciHubIngestion" : "2018-01-21T18:54:53.748Z",
"s3Ingestion" : "2018-01-21T19:04:58.796Z",
"tiles" : [
{
"path" : "tiles/23/V/NH/2018/1/21/0",
"timestamp" : "2018-01-21T14:15:04.455Z",
"utmZone" : 23,
"latitudeBand" : "V",
"gridSquare" : "NH",
"datastrip" : {
"id" : "S2A_OPER_MSI_L1C_DS_SGS__20180121T160435_S20180121T141504_N02.06",
"path" : "products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435/datastrip/0"
}
}
],
"datastrips" : [
{
"id" : "S2A_OPER_MSI_L1C_DS_SGS__20180121T160435_S20180121T141504_N02.06",
"path" : "products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435/datastrip/0"
}
]
}
{
"Type" : "Notification",
"MessageId" : "ae60e465-0118-507c-ba6c-b6bbe7b6757e",
"TopicArn" : "arn:aws:sns:eu-west-1:214830741341:NewSentinel2Product",
"Subject" : "S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435",
"Message" : "{\n \"name\" : \"S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435\",\n \"id\" : \"91b49eb5-735f-4043-aff1-bb67f6d51db7\",\n \"path\" : \"products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435\",\n \"timestamp\" : \"2018-01-21T14:15:01.026Z\",\n \"datatakeIdentifier\" : \"GS2A_20180121T141501_013492_N02.06\",\n \"sciHubIngestion\" : \"2018-01-21T18:54:53.748Z\",\n \"s3Ingestion\" : \"2018-01-21T19:04:58.796Z\",\n \"tiles\" : [ {\n \"path\" : \"tiles/23/V/NH/2018/1/21/0\",\n \"timestamp\" : \"2018-01-21T14:15:04.455Z\",\n \"utmZone\" : 23,\n \"latitudeBand\" : \"V\",\n \"gridSquare\" : \"NH\",\n \"datastrip\" : {\n \"id\" : \"S2A_OPER_MSI_L1C_DS_SGS__20180121T160435_S20180121T141504_N02.06\",\n \"path\" : \"products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435/datastrip/0\"\n }\n } ],\n \"datastrips\" : [ {\n \"id\" : \"S2A_OPER_MSI_L1C_DS_SGS__20180121T160435_S20180121T141504_N02.06\",\n \"path\" : \"products/2018/1/21/S2A_MSIL1C_20180121T141501_N0206_R053_T23VNH_20180121T160435/datastrip/0\"\n } ]\n}",
"Timestamp" : "2018-01-21T19:05:18.845Z",
"SignatureVersion" : "1",
"Signature" : "fRrvfYj+YL4eVknTuGnjW7zrxcCBRJcB88najoZ1VDrArWkIpixMtjEimequwxSqs4eS/pl74LeTqMYn2j5bPsrIchjOXQ5xnu2fyp1zHVYOLmVTNrRlEa69szYQWAEXgSGx9OUXuC2B2U8CG1V7doZhxCvMiOm430JiVRhKbEbMyK9ud4U9vh04K5BonTPuYi5Z+7N03QSb5rJknljiXCR5oLcmzhCC2cl6xJsVEDwbcMpd0BCW4xFrdEnHx4eKrQlCKJKr2ZlILCSO+hPWhqOFSjI8DY/xieA6Ro6//FapTXmtwqoTzG+sR0M3ibb2Lhv/xJwU8iFnKEKEAgHOnA==",
"SigningCertURL" : "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
"UnsubscribeURL" : "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:214830741341:NewSentinel2Product:def61c1b-1dcc-4596-9ade-42cc50b7fc88"
}
@brycejohnston
Copy link
Author

product_str = notification
product = Oj.load(product_str)
message = Oj.load(product["Message"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment