provider

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSubscriptionRequired = "SubscriptionRequiredException"
)

Variables

View Source
var ResourceTypes = map[string]model.ResourceType{

	"CloudFlare/Access/Application": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Access/Application",
		Tags: map[string][]string{
			"category": {"Access"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccessApplications),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccessApplication),
	},

	"CloudFlare/Access/Group": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Access/Group",
		Tags: map[string][]string{
			"category": {"Access"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccessGroups),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccessGroup),
	},

	"CloudFlare/Access/Policy": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Access/Policy",
		Tags: map[string][]string{
			"category": {"Access"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccessPolicies),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccessPolicy),
	},

	"CloudFlare/Account": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Account",
		Tags: map[string][]string{
			"category": {"Account"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccounts),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccount),
	},

	"CloudFlare/Account/Member": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Account/Member",
		Tags: map[string][]string{
			"category": {"Account"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccountMembers),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccountMember),
	},

	"CloudFlare/Account/Role": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Account/Role",
		Tags: map[string][]string{
			"category": {"Account"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAccountRoles),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAccountRole),
	},

	"CloudFlare/ApiToken": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/ApiToken",
		Tags: map[string][]string{
			"category": {"ApiToken"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListAPITokens),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetAPIToken),
	},

	"CloudFlare/DNSRecord": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/DNSRecord",
		Tags: map[string][]string{
			"category": {"DNSRecord"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListDNSRecords),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetDNSRecord),
	},

	"CloudFlare/Firewall/Rule": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Firewall/Rule",
		Tags: map[string][]string{
			"category": {"Firewall"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListFireWallRules),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetFireWallRule),
	},

	"CloudFlare/LoadBalancer": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/LoadBalancer",
		Tags: map[string][]string{
			"category": {"LoadBalancer"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListLoadBalancers),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetLoadBalancer),
	},

	"CloudFlare/LoadBalancer/Monitor": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/LoadBalancer/Monitor",
		Tags: map[string][]string{
			"category": {"LoadBalancer"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListLoadBalancerMonitors),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetLoadBalancerMonitor),
	},

	"CloudFlare/LoadBalancer/Pool": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/LoadBalancer/Pool",
		Tags: map[string][]string{
			"category": {"LoadBalancer"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListLoadBalancerPools),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetLoadBalancerPool),
	},

	"CloudFlare/PageRule": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/PageRule",
		Tags: map[string][]string{
			"category": {"PageRule"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListPageRules),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetPageRule),
	},

	"CloudFlare/User": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/User",
		Tags: map[string][]string{
			"category": {"User"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListUsers),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetUser),
	},

	"CloudFlare/User/AuditLog": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/User/AuditLog",
		Tags: map[string][]string{
			"category": {"User"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListUserAuditLogs),
		GetDescriber:  nil,
	},

	"CloudFlare/WorkerRoute": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/WorkerRoute",
		Tags: map[string][]string{
			"category": {"WorkerRoute"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListWorkerRoutes),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetWorkerRoute),
	},

	"CloudFlare/Zone": {
		IntegrationType: configs.IntegrationName,
		ResourceName:    "CloudFlare/Zone",
		Tags: map[string][]string{
			"category": {"Zone"},
		},
		Labels:        map[string]string{},
		Annotations:   map[string]string{},
		ListDescriber: DescribeListByCloudFlare(describer.ListZones),
		GetDescriber:  DescribeSingleByCloudFlare(describer.GetZone),
	},
}

Functions

func AccountCredentialsFromMap

func AccountCredentialsFromMap(m map[string]any) (configs.IntegrationCredentials, error)

AccountCredentialsFromMap TODO: converts a map to an configs.IntegrationCredentials.

func AdjustResource

func AdjustResource(job describe.DescribeJob, resource *model.Resource) error

AdjustResource TODO: Do any needed adjustment on resource object before storing

func DescribeListByCloudFlare

func DescribeListByCloudFlare(describe func(context.Context, *describer.CloudFlareAPIHandler, *model.StreamSender) ([]model.Resource, error)) model.ResourceDescriber

DescribeListByCloudFlare A wrapper to pass cloudflare authorization to describer functions

func DescribeSingleByCloudFlare

func DescribeSingleByCloudFlare(describe func(context.Context, *describer.CloudFlareAPIHandler, string) (*model.Resource, error)) model.SingleResourceDescriber

DescribeSingleByCloudFlare A wrapper to pass cloudflare authorization to describer functions

func GetAdditionalParameters

func GetAdditionalParameters(job describe.DescribeJob) (map[string]string, error)

GetAdditionalParameters TODO: pass additional parameters needed in describer wrappers in /provider/describer_wrapper.go

func GetResourceMetadata

func GetResourceMetadata(job describe.DescribeJob, resource model.Resource) (map[string]string, error)

GetResourceMetadata TODO: Get metadata as a map to add to the resources

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL