bakshay
bakshay

Reputation: 43

c# - aws api gateway flush cache

Is there any way to flush aws API gateway cache for the particular stage through c# code? I have a requirement to synchronize my api with frequently changing data at the backend. Once data updated in database my code should clear the api gateway cache so that user will see the updated result on the UI.

I found articles in aws which uses CLI commands to clear cache. Below is the link for reference Please help me to find the similar c# code for the same.

Upvotes: 1

Views: 453

Answers (1)

SandipD
SandipD

Reputation: 11

{

AmazonAPIGatewayClient amazonAPIGatewayClient = new 
AmazonAPIGatewayClient(Amazon.RegionEndpoint.EUWest1);
FlushStageCacheRequest req = new FlushStageCacheRequest
 {
            RestApiId = "APIID",
           StageName = "yourAPIstagename"
};
        FlushStageCacheResponse response = 
amazonAPIGatewayClient.FlushStageCacheAsync(req).Result;

}

Upvotes: 1

Related Questions