# Annotations ## Get latest annotations `client.Radar.Annotations.List(ctx, query) (*AnnotationListResponse, error)` **get** `/radar/annotations` Retrieves the latest annotations. ### Parameters - `query AnnotationListParams` - `ASN param.Field[int64]` Filters results by Autonomous System. Specify a single Autonomous System Number (ASN) as integer. - `DataSource param.Field[AnnotationListParamsDataSource]` Filters results by data source. - `const AnnotationListParamsDataSourceAll AnnotationListParamsDataSource = "ALL"` - `const AnnotationListParamsDataSourceAIBots AnnotationListParamsDataSource = "AI_BOTS"` - `const AnnotationListParamsDataSourceAIGateway AnnotationListParamsDataSource = "AI_GATEWAY"` - `const AnnotationListParamsDataSourceBGP AnnotationListParamsDataSource = "BGP"` - `const AnnotationListParamsDataSourceBots AnnotationListParamsDataSource = "BOTS"` - `const AnnotationListParamsDataSourceConnectionAnomaly AnnotationListParamsDataSource = "CONNECTION_ANOMALY"` - `const AnnotationListParamsDataSourceCT AnnotationListParamsDataSource = "CT"` - `const AnnotationListParamsDataSourceDNS AnnotationListParamsDataSource = "DNS"` - `const AnnotationListParamsDataSourceDNSMagnitude AnnotationListParamsDataSource = "DNS_MAGNITUDE"` - `const AnnotationListParamsDataSourceDNSAS112 AnnotationListParamsDataSource = "DNS_AS112"` - `const AnnotationListParamsDataSourceDos AnnotationListParamsDataSource = "DOS"` - `const AnnotationListParamsDataSourceEmailRouting AnnotationListParamsDataSource = "EMAIL_ROUTING"` - `const AnnotationListParamsDataSourceEmailSecurity AnnotationListParamsDataSource = "EMAIL_SECURITY"` - `const AnnotationListParamsDataSourceFw AnnotationListParamsDataSource = "FW"` - `const AnnotationListParamsDataSourceFwPg AnnotationListParamsDataSource = "FW_PG"` - `const AnnotationListParamsDataSourceHTTP AnnotationListParamsDataSource = "HTTP"` - `const AnnotationListParamsDataSourceHTTPControl AnnotationListParamsDataSource = "HTTP_CONTROL"` - `const AnnotationListParamsDataSourceHTTPCrawlerReferer AnnotationListParamsDataSource = "HTTP_CRAWLER_REFERER"` - `const AnnotationListParamsDataSourceHTTPOrigins AnnotationListParamsDataSource = "HTTP_ORIGINS"` - `const AnnotationListParamsDataSourceIQI AnnotationListParamsDataSource = "IQI"` - `const AnnotationListParamsDataSourceLeakedCredentials AnnotationListParamsDataSource = "LEAKED_CREDENTIALS"` - `const AnnotationListParamsDataSourceNet AnnotationListParamsDataSource = "NET"` - `const AnnotationListParamsDataSourceRobotsTXT AnnotationListParamsDataSource = "ROBOTS_TXT"` - `const AnnotationListParamsDataSourceSpeed AnnotationListParamsDataSource = "SPEED"` - `const AnnotationListParamsDataSourceWorkersAI AnnotationListParamsDataSource = "WORKERS_AI"` - `DateEnd param.Field[Time]` End of the date range (inclusive). - `DateRange param.Field[string]` Filters results by date range. - `DateStart param.Field[Time]` Start of the date range (inclusive). - `EventType param.Field[AnnotationListParamsEventType]` Filters results by event type. - `const AnnotationListParamsEventTypeEvent AnnotationListParamsEventType = "EVENT"` - `const AnnotationListParamsEventTypeGeneral AnnotationListParamsEventType = "GENERAL"` - `const AnnotationListParamsEventTypeOutage AnnotationListParamsEventType = "OUTAGE"` - `const AnnotationListParamsEventTypePartialProjection AnnotationListParamsEventType = "PARTIAL_PROJECTION"` - `const AnnotationListParamsEventTypePipeline AnnotationListParamsEventType = "PIPELINE"` - `const AnnotationListParamsEventTypeTrafficAnomaly AnnotationListParamsEventType = "TRAFFIC_ANOMALY"` - `Format param.Field[AnnotationListParamsFormat]` Format in which results will be returned. - `const AnnotationListParamsFormatJson AnnotationListParamsFormat = "JSON"` - `const AnnotationListParamsFormatCsv AnnotationListParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Location param.Field[string]` Filters results by location. Specify an alpha-2 location code. - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. - `Origin param.Field[string]` Filters results by origin. ### Returns - `type AnnotationListResponse struct{…}` - `Annotations []AnnotationListResponseAnnotation` - `ID string` - `ASNs []int64` - `ASNsDetails []AnnotationListResponseAnnotationsASNsDetail` - `ASN string` - `Name string` - `Locations AnnotationListResponseAnnotationsASNsDetailsLocations` - `Code string` - `Name string` - `DataSource string` - `EventType string` - `Locations []string` - `LocationsDetails []AnnotationListResponseAnnotationsLocationsDetail` - `Code string` - `Name string` - `Origins []string` - `OriginsDetails []AnnotationListResponseAnnotationsOriginsDetail` - `Name string` - `Origin string` - `Outage AnnotationListResponseAnnotationsOutage` - `OutageCause string` - `OutageType string` - `StartDate string` - `Description string` - `EndDate string` - `LinkedURL string` - `Scope string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) annotations, err := client.Radar.Annotations.List(context.TODO(), radar.AnnotationListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", annotations.Annotations) } ``` #### Response ```json { "result": { "annotations": [ { "id": "550", "asns": [ 189 ], "asnsDetails": [ { "asn": "189", "name": "LUMEN-LEGACY-L3-PARTITION", "locations": { "code": "US", "name": "United States" } } ], "dataSource": "ALL", "eventType": "OUTAGE", "locations": [ "US" ], "locationsDetails": [ { "code": "US", "name": "United States" } ], "origins": [ "amazon-us-east-1" ], "originsDetails": [ { "name": "us-east-1 Amazon Web Services", "origin": "amazon-us-east-1" } ], "outage": { "outageCause": "CABLE_CUT", "outageType": "NATIONWIDE" }, "startDate": "2022-09-06T10:00:28Z", "description": "example", "endDate": "2022-09-08T10:00:28Z", "linkedUrl": "http://example.com", "scope": "Colima, Michoacán, México" } ] }, "success": true } ``` # Outages ## Get latest Internet outages and anomalies `client.Radar.Annotations.Outages.Get(ctx, query) (*AnnotationOutageGetResponse, error)` **get** `/radar/annotations/outages` Retrieves the latest Internet outages and anomalies. ### Parameters - `query AnnotationOutageGetParams` - `ASN param.Field[int64]` Filters results by Autonomous System. Specify a single Autonomous System Number (ASN) as integer. - `DateEnd param.Field[Time]` End of the date range (inclusive). - `DateRange param.Field[string]` Filters results by date range. - `DateStart param.Field[Time]` Start of the date range (inclusive). - `Format param.Field[AnnotationOutageGetParamsFormat]` Format in which results will be returned. - `const AnnotationOutageGetParamsFormatJson AnnotationOutageGetParamsFormat = "JSON"` - `const AnnotationOutageGetParamsFormatCsv AnnotationOutageGetParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. - `Location param.Field[string]` Filters results by location. Specify an alpha-2 location code. - `Offset param.Field[int64]` Skips the specified number of objects before fetching the results. - `Origin param.Field[string]` Filters results by origin. ### Returns - `type AnnotationOutageGetResponse struct{…}` - `Annotations []AnnotationOutageGetResponseAnnotation` - `ID string` - `ASNs []int64` - `ASNsDetails []AnnotationOutageGetResponseAnnotationsASNsDetail` - `ASN string` - `Name string` - `Locations AnnotationOutageGetResponseAnnotationsASNsDetailsLocations` - `Code string` - `Name string` - `DataSource string` - `EventType string` - `Locations []string` - `LocationsDetails []AnnotationOutageGetResponseAnnotationsLocationsDetail` - `Code string` - `Name string` - `Origins []string` - `OriginsDetails []AnnotationOutageGetResponseAnnotationsOriginsDetail` - `Name string` - `Origin string` - `Outage AnnotationOutageGetResponseAnnotationsOutage` - `OutageCause string` - `OutageType string` - `StartDate Time` - `Description string` - `EndDate Time` - `LinkedURL string` - `Scope string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) outage, err := client.Radar.Annotations.Outages.Get(context.TODO(), radar.AnnotationOutageGetParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", outage.Annotations) } ``` #### Response ```json { "result": { "annotations": [ { "id": "550", "asns": [ 189 ], "asnsDetails": [ { "asn": "189", "name": "LUMEN-LEGACY-L3-PARTITION", "locations": { "code": "US", "name": "United States" } } ], "dataSource": "ALL", "eventType": "OUTAGE", "locations": [ "US" ], "locationsDetails": [ { "code": "US", "name": "United States" } ], "origins": [ "amazon-us-east-1" ], "originsDetails": [ { "name": "us-east-1 Amazon Web Services", "origin": "amazon-us-east-1" } ], "outage": { "outageCause": "CABLE_CUT", "outageType": "NATIONWIDE" }, "startDate": "2019-12-27T18:11:19.117Z", "description": "example", "endDate": "2019-12-27T18:11:19.117Z", "linkedUrl": "http://example.com", "scope": "Colima, Michoacán, México" } ] }, "success": true } ``` ## Get the number of outages by location `client.Radar.Annotations.Outages.Locations(ctx, query) (*AnnotationOutageLocationsResponse, error)` **get** `/radar/annotations/outages/locations` Retrieves the number of outages by location. ### Parameters - `query AnnotationOutageLocationsParams` - `DateEnd param.Field[Time]` End of the date range (inclusive). - `DateRange param.Field[string]` Filters results by date range. - `DateStart param.Field[Time]` Start of the date range (inclusive). - `Format param.Field[AnnotationOutageLocationsParamsFormat]` Format in which results will be returned. - `const AnnotationOutageLocationsParamsFormatJson AnnotationOutageLocationsParamsFormat = "JSON"` - `const AnnotationOutageLocationsParamsFormatCsv AnnotationOutageLocationsParamsFormat = "CSV"` - `Limit param.Field[int64]` Limits the number of objects returned in the response. ### Returns - `type AnnotationOutageLocationsResponse struct{…}` - `Annotations []AnnotationOutageLocationsResponseAnnotation` - `ClientCountryAlpha2 string` - `ClientCountryName string` - `Value string` A numeric string. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/radar" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Radar.Annotations.Outages.Locations(context.TODO(), radar.AnnotationOutageLocationsParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Annotations) } ``` #### Response ```json { "result": { "annotations": [ { "clientCountryAlpha2": "PT", "clientCountryName": "Portugal", "value": "10" } ] }, "success": true } ```