create_security_group
¶
create_security_group(
network_id: NetworkId,
name: GenericString,
security_group_settings: SecurityGroupSettingsRequest,
*,
config_overrides: Optional[WickrClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> CreateSecurityGroupResponse
Creates a new security group in a Wickr network. Security groups allow you to organize users and control their permissions, features, and security settings.
Parameters:
-
network_id(NetworkId) –The ID of the Wickr network where the security group will be created.
-
name(GenericString) –The name for the new security group.
-
security_group_settings(SecurityGroupSettingsRequest) –The configuration settings for the security group, including permissions, federation settings, and feature controls.
-
client_token(Optional[ClientToken], default:None) –A unique identifier for this request to ensure idempotency.
Raises:
-
BadRequestError–The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.
-
ForbiddenError–Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.
-
InternalServerError–An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.
-
RateLimitError–The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.
-
ResourceNotFoundError–The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.
-
UnauthorizedError–The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.
-
ValidationError–One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create security group successfully
>>> client.create_security_group(network_id='12345678', name='engineering', security_group_settings={'federationMode': 1, 'lockoutThreshold': 10})
Create security group - missing name
>>> client.create_security_group(network_id='12345678', name='', security_group_settings={'federationMode': 1})
Source code in docs_src/capo_wickr/_services/wickr.py
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 | |