C# Class UmbracoFlare.ApiControllers.CloudflareApiController

Inheritance: Umbraco.Web.WebApi.UmbracoAuthorizedApiController
Afficher le fichier Open project: scyllagroup/UmbracoFlare Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
AddRequestHeaders ( HttpRequestMessage request ) : void

Method Details

CloudflareApiController() public méthode

public CloudflareApiController ( ) : System
Résultat System

GetSSLStatus() public méthode

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
Résultat UmbracoFlare.Models.SslEnabledResponse

GetUserDetails() public méthode

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
Résultat UmbracoFlare.Models.UserDetails

ListZones() public méthode

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
Résultat List

PurgeCache() public méthode

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
Résultat bool