createSite method

Future<CreateSiteResponse> createSite({
  1. required String globalNetworkId,
  2. String? description,
  3. Location? location,
  4. List<Tag>? tags,
})

Creates a new site in a global network.

May throw ValidationException. May throw ServiceQuotaExceededException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ConflictException. May throw ThrottlingException. May throw InternalServerException.

Parameter globalNetworkId : The ID of the global network.

Parameter description : A description of your site.

Length Constraints: Maximum length of 256 characters.

Parameter location : The site location. This information is used for visualization in the Network Manager console. If you specify the address, the latitude and longitude are automatically calculated.

  • Address: The physical address of the site.
  • Latitude: The latitude of the site.
  • Longitude: The longitude of the site.

Parameter tags : The tags to apply to the resource during creation.

Implementation

Future<CreateSiteResponse> createSite({
  required String globalNetworkId,
  String? description,
  Location? location,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  final $payload = <String, dynamic>{
    if (description != null) 'Description': description,
    if (location != null) 'Location': location,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/sites',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSiteResponse.fromJson(response);
}