C# Class UmbracoFlare.ApiControllers.CloudflareApiController

Inheritance: Umbraco.Web.WebApi.UmbracoAuthorizedApiController
Mostra file Open project: scyllagroup/UmbracoFlare Class Usage Examples

Public Methods

Method Description
CloudflareApiController ( ) : System
GetSSLStatus ( string zoneId ) : SslEnabledResponse

Gets the user details for the current users credentials in the config. This is useful to test if the credentials are valid.

GetUserDetails ( ) : UserDetails

Gets the user details for the current users credentials in the config. This is useful to test if the credentials are valid.

ListZones ( string name = null, bool throwExceptionOnFail = false ) : List

Call the cloudflare api to get a list of zones associated with this api key / account email combo. If you pass in a name (domain name), it will return that zone.

PurgeCache ( string zoneIdentifier, IEnumerable urls, bool purgeEverything = false, bool throwExceptionOnError = false ) : bool

This will call the Cloudflare api and will purge the individual pages or files given in the urls parameter.

Private Methods

Method Description
AddRequestHeaders ( HttpRequestMessage request ) : void

Method Details

CloudflareApiController() public method

public CloudflareApiController ( ) : System
return System

GetSSLStatus() public method

Gets the user details for the current users credentials in the config. This is useful to test if the credentials are valid.
public GetSSLStatus ( string zoneId ) : SslEnabledResponse
zoneId string
return UmbracoFlare.Models.SslEnabledResponse

GetUserDetails() public method

Gets the user details for the current users credentials in the config. This is useful to test if the credentials are valid.
public GetUserDetails ( ) : UserDetails
return UmbracoFlare.Models.UserDetails

ListZones() public method

Call the cloudflare api to get a list of zones associated with this api key / account email combo. If you pass in a name (domain name), it will return that zone.
public ListZones ( string name = null, bool throwExceptionOnFail = false ) : List
name string The domain name of the zone that you wish to get the info about. If you want all of them, leave it blank.
throwExceptionOnFail bool
return List

PurgeCache() public method

This will call the Cloudflare api and will purge the individual pages or files given in the urls parameter.
public PurgeCache ( string zoneIdentifier, IEnumerable urls, bool purgeEverything = false, bool throwExceptionOnError = false ) : bool
zoneIdentifier string This is the id of the zone you want to purge the urls from. Can be obtained through ListZones
urls IEnumerable The urls of the pages/files that you want to purge the cache for on cloudflare. If it is empty or null, the function will just return /// and no api call will be made.
purgeEverything bool If set to true, the urls will be ignored and we will purge everything.
throwExceptionOnError bool
return bool