updateScope method

Future<UpdateScopeOutput> updateScope({
  1. required String scopeId,
  2. List<TargetResource>? resourcesToAdd,
  3. List<TargetResource>? resourcesToDelete,
})

Update a scope to add or remove resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend.

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

Parameter scopeId : The identifier for the scope that includes the resources you want to get data results for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.

Parameter resourcesToAdd : A list of resources to add to a scope.

Parameter resourcesToDelete : A list of resources to delete from a scope.

Implementation

Future<UpdateScopeOutput> updateScope({
  required String scopeId,
  List<TargetResource>? resourcesToAdd,
  List<TargetResource>? resourcesToDelete,
}) async {
  final $payload = <String, dynamic>{
    if (resourcesToAdd != null) 'resourcesToAdd': resourcesToAdd,
    if (resourcesToDelete != null) 'resourcesToDelete': resourcesToDelete,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/scopes/${Uri.encodeComponent(scopeId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateScopeOutput.fromJson(response);
}