- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DescribeEventsForOrganizationCommand
Returns information about events across your organization in Organizations. You can use thefilters
parameter to specify the events that you want to return. Events are returned in a summary form and don't include the affected accounts, detailed description, any additional metadata that depends on the event type, or any affected resources. To retrieve that information, use the following operations:
If you don't specify a filter
, the DescribeEventsForOrganizations
returns all events across your organization. Results are sorted by lastModifiedTime
, starting with the most recent event.
For more information about the different types of Health events, see Event .
Before you can call this operation, you must first enable Health to work with Organizations. To do this, call the EnableHealthServiceAccessForOrganization operation from your organization's management account.
This API operation uses pagination. Specify the nextToken
parameter in the next request to return more results.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { HealthClient, DescribeEventsForOrganizationCommand } from "@aws-sdk/client-health"; // ES Modules import
// const { HealthClient, DescribeEventsForOrganizationCommand } = require("@aws-sdk/client-health"); // CommonJS import
const client = new HealthClient(config);
const input = { // DescribeEventsForOrganizationRequest
filter: { // OrganizationEventFilter
eventTypeCodes: [ // eventTypeList2
"STRING_VALUE",
],
awsAccountIds: [ // awsAccountIdsList
"STRING_VALUE",
],
services: [ // serviceList
"STRING_VALUE",
],
regions: [ // regionList
"STRING_VALUE",
],
startTime: { // DateTimeRange
from: new Date("TIMESTAMP"),
to: new Date("TIMESTAMP"),
},
endTime: {
from: new Date("TIMESTAMP"),
to: new Date("TIMESTAMP"),
},
lastUpdatedTime: {
from: new Date("TIMESTAMP"),
to: new Date("TIMESTAMP"),
},
entityArns: [ // entityArnList
"STRING_VALUE",
],
entityValues: [ // entityValueList
"STRING_VALUE",
],
eventTypeCategories: [ // eventTypeCategoryList2
"issue" || "accountNotification" || "scheduledChange" || "investigation",
],
eventStatusCodes: [ // eventStatusCodeList
"open" || "closed" || "upcoming",
],
},
nextToken: "STRING_VALUE",
maxResults: Number("int"),
locale: "STRING_VALUE",
};
const command = new DescribeEventsForOrganizationCommand(input);
const response = await client.send(command);
// { // DescribeEventsForOrganizationResponse
// events: [ // OrganizationEventList
// { // OrganizationEvent
// arn: "STRING_VALUE",
// service: "STRING_VALUE",
// eventTypeCode: "STRING_VALUE",
// eventTypeCategory: "issue" || "accountNotification" || "scheduledChange" || "investigation",
// eventScopeCode: "PUBLIC" || "ACCOUNT_SPECIFIC" || "NONE",
// region: "STRING_VALUE",
// startTime: new Date("TIMESTAMP"),
// endTime: new Date("TIMESTAMP"),
// lastUpdatedTime: new Date("TIMESTAMP"),
// statusCode: "open" || "closed" || "upcoming",
// },
// ],
// nextToken: "STRING_VALUE",
// };
DescribeEventsForOrganizationCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
filter | OrganizationEventFilter | undefined | Values to narrow the results returned. |
locale | string | undefined | The locale (language) to return information in. English (en) is the default and the only supported value at this time. |
maxResults | number | undefined | The maximum number of items to return in one batch, between 10 and 100, inclusive. |
nextToken | string | undefined | If the results of a search are large, only a portion of the results are returned, and a |
DescribeEventsForOrganizationCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
events | OrganizationEvent[] | undefined | The events that match the specified filter criteria. |
nextToken | string | undefined | If the results of a search are large, only a portion of the results are returned, and a |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidPaginationToken | client | The specified pagination token ( |
UnsupportedLocale | client | The specified locale is not supported. |
HealthServiceException | Base exception class for all service exceptions from Health service. |