Creates a new behavior graph for the calling account, and sets that account as the administrator account. This operation is called by the account that is enabling Detective.
The operation also enables Detective for the calling account in the currently selected Region. It returns the ARN of the new behavior graph.
CreateGraph triggers a process to create the corresponding data tables for the new behavior graph.
An account can only be the administrator account for one behavior graph within a Region. If the same account calls CreateGraph with the same administrator account, it always returns the same behavior graph ARN. It does not create a new behavior graph.
Parameters:
-
tags
(Optional[TagMap], default:
None
)
–
The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.
Raises:
-
AccessDeniedException
–
The request issuer does not have permission to access this resource or perform this operation.
-
ConflictException
–
The request attempted an invalid action.
-
InternalServerException
–
The request was valid but failed because of a problem with the service.
-
ServiceQuotaExceededException
–
This request cannot be completed for one of the following reasons.
-
This request cannot be completed if it would cause the number of member accounts in the behavior graph to exceed the maximum allowed. A behavior graph cannot have more than 1,200 member accounts.
-
This request cannot be completed if the current volume ingested is above the limit of 10 TB per day. Detective will not allow you to add additional member accounts.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_detective/_services/async_detective.py
| async def create_graph(
self,
*,
config_overrides: Optional[AsyncDetectiveClientConfig] = None,
tags: Optional["capo_detective.types.tag_map.TagMap"] = None,
) -> "capo_detective.types.create_graph_response.CreateGraphResponse":
"""<p>Creates a new behavior graph for the calling account, and sets that account as the administrator account. This operation is called by the account that is enabling Detective.</p> <p>The operation also enables Detective for the calling account in the currently selected Region. It returns the ARN of the new behavior graph.</p> <p> <code>CreateGraph</code> triggers a process to create the corresponding data tables for the new behavior graph.</p> <p>An account can only be the administrator account for one behavior graph within a Region. If the same account calls <code>CreateGraph</code> with the same administrator account, it always returns the same behavior graph ARN. It does not create a new behavior graph.</p>
Args:
tags: <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>
Raises:
capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
capo_detective.errors.conflict_exception.ConflictException: <p>The request attempted an invalid action.</p>
capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
capo_detective.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This request cannot be completed for one of the following reasons.</p> <ul> <li> <p>This request cannot be completed if it would cause the number of member accounts in the behavior graph to exceed the maximum allowed. A behavior graph cannot have more than 1,200 member accounts.</p> </li> <li> <p>This request cannot be completed if the current volume ingested is above the limit of 10 TB per day. Detective will not allow you to add additional member accounts.</p> </li> </ul>
capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_detective.types.create_graph_request.CreateGraphRequest]",
) -> AsyncOperationResponse[
"capo_detective.types.create_graph_response.CreateGraphResponse"
]:
import capo_detective._operations.amazon_detective.create_graph
(
output,
http_response,
) = await capo_detective._operations.amazon_detective.create_graph.async_create_graph(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateGraph")
)
input_: capo_detective.types.create_graph_request.CreateGraphRequest = {}
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|