title: How to use the nextToken in the ListMetrics function
body: <p>I am trying to list all the metrics stored in CloudWatch using the function: ListMetrics.
  The function returns about 500 metrics and a string value called NextToken that is to be used in the next call to get the rest of the metrics. </p>
  
  <p>This is my code below but I do not know how to use the NextToken to get the rest of the metrics. </p>
  
  <pre><code>  // creates the CloudWatch client
              var cw = Amazon.AWSClientFactory.CreateAmazonCloudWatchClient(Amazon.RegionEndpoint.EUWest1);
          // initialses the list metrics request
          ListMetricsRequest lmr = new ListMetricsRequest();
          ListMetricsResponse lmresponse = cw.ListMetrics(lmr);
  
  
  
          // loop that uses the token to get all the metrics available
          // not finished yet
          do
          {
              lmresponse = cw.ListMetrics(lmr);
              lmresponse.NextToken;
  
          } while (lmresponse.NextToken != null);
  </code></pre>
  
  <p>I would like to know how to use the NextToken in order to get the rest of the metrics. I couldn't find any examples online unfortunately. </p>