Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module github.com/cloudflare/cloudflare-go to v2 #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 1, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/cloudflare/cloudflare-go v0.44.0 -> v2.2.0 age adoption passing confidence

Release Notes

cloudflare/cloudflare-go (github.com/cloudflare/cloudflare-go)

v2.2.0

Compare Source

[!WARNING]

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

2.2.0 (2024-05-08)

Full Changelog: v2.1.0...v2.2.0

Features
Chores

v2.1.0

Compare Source

[!WARNING]

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

2.1.0 (2024-04-23)

Full Changelog: v2.0.0...v2.1.0

Features

v2.0.0

Compare Source

[!WARNING]

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

This package should be in a usable state for many projects, but expect frequent minor breaking
changes as we rename methods and types. If this isn't suitable for you project, we recommend
pinning to the 0.x releases for now.

Install

go get -u github.com/cloudflare/cloudflare-go/v2

Migration guide

What's changed

v2.x of this library is a ground-up rewrite of the SDK, using code generation from our OpenAPI spec.

Automatic migration

For assisting with automatic migrations, we have provided a GritQL pattern. Once you install Grit locally, you can run the following to handle some of the upgrade.

grit apply go_cloudflare_v2

[!NOTE]

Due to the massive rewrite, not all methods have a way to represent the previous method signatures or structs they relied on. Instead of writing a migration that will likely incorrectly identify these, we have instead provided the method renames which will allow you to inspect the method usage and what values it requires.

Future migrations will be more seamless as we will be automatically generating these based on version diffs instead.

Manual migration
Client construction with API key and email

Old:

package main

func main() {
  api, err := cloudflare.New(os.Getenv("CLOUDFLARE_API_KEY"), os.Getenv("CLOUDFLARE_API_EMAIL"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithAPIKey(os.Getenv("CLOUDFLARE_API_KEY")),
    option.WithAPIEmail(os.Getenv("CLOUDFLARE_API_EMAIL"))
  )
}
Client construction with API token

Old:

package main

func main() {
  api, err := cloudflare.NewWithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
  )
}
Client construction with user service key

Old:

package main

func main() {
  api, err := cloudflare.NewWithUserServiceKey(os.Getenv("CLOUDFLARE_USER_SERVICE_KEY"))
}

New:

package main

func main() {
  api := cloudflare.NewClient(
    option.WithUserServiceKey(os.Getenv("CLOUDFLARE_USER_SERVICE_KEY"))
  )
}
Method renames
  • AccessAuditLogs -> ZeroTrust.Access.Logs
  • ListHyperdriveConfigs -> Hyperdrive.Configs.List
  • CreateHyperdriveConfig -> Hyperdrive.Config.New
  • DeleteHyperdriveConfig -> Hyperdrive.Config.Delete
  • GetHyperdriveConfig -> Hyperdrive.Config.Get
  • UpdateHyperdriveConfig -> Hyperdrive.Config.Update
  • CreateDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.New
  • UpdateDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.Update
  • DevicePostureIntegration -> ZeroTrust.Devices.Posture.Integration.Get
  • DevicePostureIntegrations -> ZeroTrust.Devices.Posture.Integrations.List
  • DeleteDevicePostureIntegration -> ZeroTrust.Devices.Posture.Integrations.Delete
  • ListEmailRoutingDestinationAddresses -> EmailRouting.Destination.Addresses.List
  • CreateEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.New
  • GetEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.Get
  • DeleteEmailRoutingDestinationAddress -> EmailRouting.Destination.Address.Delete
  • DevicePostureRules -> ZeroTrust.Devices.Postures.List
  • DevicePostureRule -> ZeroTrust.Devices.Posture.Get
  • CreateDevicePostureRule -> ZeroTrust.Devices.Posture.New
  • UpdateDevicePostureRule -> ZeroTrust.Devices.Posture.Update
  • DeleteDevicePostureRule -> ZeroTrust.Devices.Posture.Delete
  • ListR2Buckets -> R2.Buckets.List
  • CreateR2Bucket -> R2.Buckets.New
  • GetR2Bucket -> R2.Buckets.Get
  • DeleteR2Bucket -> R2.Buckets.Delete
  • DeleteWorker -> Workers.Scripts.Delete
  • GetWorker -> Workers.Scripts.Get
  • GetWorkerWithDispatchNamespace -> WorkersForPlatforms.Dispatch.Namespaces.Scripts.Get
  • ListWorkers -> Workers.Scripts.List
  • UploadWorker -> Workers.Scripts.New
  • GetWorkersScriptContent -> Workers.Scripts.Content.Get
  • UpdateWorkersScriptContent -> Workers.Scripts.Content.Update
  • GetWorkersScriptSettings -> Workers.Scripts.Settings.Get
  • UpdateWorkersScriptSettings -> Workers.Scripts.Settings.Update
  • GetDLPPayloadLogSettings -> ZeroTrust.DLP.PayloadLogs.Get
  • UpdateDLPPayloadLogSettings -> ZeroTrust.DLP.PayloadLogs.Update
  • ListAccessCACertificates -> ZeroTrust.Access.Applications.CAs.List
  • GetAccessCACertificate -> ZeroTrust.Access.Applications.CAs.Get
  • CreateAccessCACertificate -> ZeroTrust.Access.Applications.CAs.New
  • DeleteAccessCACertificate -> ZeroTrust.Access.Applications.CAs.Delete
  • ListPageShieldScripts -> PageShield.List
  • GetPageShieldScript -> PageShield.Get
  • GetTotalTLS -> ACM.TotalTLS.Get
  • SetTotalTLS -> ACM.TotalTLS.New
  • RegistrarDomain -> Registrar.Domains.Get
  • RegistrarDomains -> Registrar.Domains.List
  • UpdateRegistrarDomain -> Registrar.Domains.Update
  • CreateWorkersAccountSettings -> Workers.AccountSettings.Update
  • WorkersAccountSettings -> Workers.AccountSettings.Get
  • ListPermissionGroups -> User.Tokens.PermissionGroups.List
  • ListMagicTransitIPsecTunnels -> MagicTransit.IPSECTunnels.List
  • GetMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Get
  • CreateMagicTransitIPsecTunnels -> MagicTransit.IPSECTunnels.New
  • UpdateMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Update
  • DeleteMagicTransitIPsecTunnel -> MagicTransit.IPSECTunnels.Delete
  • GenerateMagicTransitIPsecTunnelPSK -> MagicTransit.IPSECTunnels.PSKGenerate
  • CreateZoneHold -> Zones.Holds.New
  • DeleteZoneHold -> Zones.Holds.Delete
  • GetZoneHold -> Zones.Holds.Get
  • ListZoneManagedHeaders -> ManagedHeaders.List
  • UpdateZoneManagedHeaders -> ManagedHeaders.Update
  • ListAccessPolicies -> ZeroTrust.Access.Applications.Policies.List
  • GetAccessPolicy -> ZeroTrust.Access.Applications.Policies.Get
  • CreateAccessPolicy -> ZeroTrust.Access.Applications.Policies.New
  • UpdateAccessPolicy -> ZeroTrust.Access.Applications.Policies.Update
  • DeleteAccessPolicy -> ZeroTrust.Access.Applications.Policies.Delete
  • CreateSSL -> CustomCertificates.New
  • ListSSL -> CustomCertificates.List
  • SSLDetails -> CustomCertificates.Get
  • UpdateSSL -> CustomCertificates.Update
  • ReprioritizeSSL -> CustomCertificates.Prioritize.Update
  • DeleteSSL -> CustomCertificates.Delete
  • GetCustomNameservers -> CustomNameservers.Get
  • CreateCustomNameservers -> CustomNameservers.New
  • DeleteCustomNameservers -> CustomNameservers.Delete
  • ListDexTests -> ZeroTrust.Devices.DEXTests.List
  • CreateDeviceDexTest -> ZeroTrust.Devices.DEXTests.New
  • UpdateDeviceDexTest -> ZeroTrust.Devices.DEXTests.Update
  • GetDeviceDexTest -> ZeroTrust.Devices.DEXTests.Get
  • DeleteDexTest -> ZeroTrust.Devices.DEXTests.Delete
  • AccessBookmarks -> ZeroTrust.Access.Bookmarks.List
  • ZoneLevelAccessBookmarks -> ZeroTrust.Access.Bookmarks.List
  • AccessBookmark -> ZeroTrust.Access.Bookmarks.Get
  • ZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Get
  • CreateAccessBookmark -> ZeroTrust.Access.Bookmarks.New
  • CreateZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.New
  • UpdateAccessBookmark -> ZeroTrust.Access.Bookmarks.Update
  • UpdateZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Update
  • DeleteAccessBookmark -> ZeroTrust.Access.Bookmarks.Delete
  • DeleteZoneLevelAccessBookmark -> ZeroTrust.Access.Bookmarks.Delete
  • CreateZoneLockdown -> Firewall.Lockdowns.New
  • UpdateZoneLockdown -> Firewall.Lockdowns.Update
  • DeleteZoneLockdown -> Firewall.Lockdowns.Delete
  • ZoneLockdown -> Firewall.Lockdowns.Get
  • ListZoneLockdowns -> Firewall.Lockdowns.List
  • GetRegionalTieredCache -> Cache.RegionalTieredCache.Get
  • UpdateRegionalTieredCache -> Cache.RegionalTieredCache.Edit
  • CreateWorkerRoute -> Workers.Routes.New
  • DeleteWorkerRoute -> Workers.Routes.Delete
  • ListWorkerRoutes -> Workers.Routess.List
  • GetWorkerRoute -> Workers.Routes.Get
  • UpdateWorkerRoute -> Workers.Routes.Update
  • CreateWaitingRoom -> WaitingRooms.New
  • ListWaitingRooms -> WaitingRooms.List
  • WaitingRoom -> WaitingRooms.Get
  • ChangeWaitingRoom -> WaitingRooms.Edit
  • UpdateWaitingRoom -> WaitingRooms.Update
  • DeleteWaitingRoom -> WaitingRooms.Delete
  • WaitingRoomStatus -> WaitingRooms.Status
  • WaitingRoomPagePreview -> WaitingRooms.Page.Preview
  • CreateWaitingRoomEvent -> WaitingRooms.Events.New
  • ListWaitingRoomEvents -> WaitingRooms.Events.List
  • WaitingRoomEvent -> WaitingRooms.Events.List
  • WaitingRoomEventPreview -> WaitingRooms.Events.Preview
  • ChangeWaitingRoomEvent -> WaitingRooms.Events.Edit
  • UpdateWaitingRoomEvent -> WaitingRooms.Events.Update
  • DeleteWaitingRoomEvent -> WaitingRooms.Events.Delete
  • ListWaitingRoomRules -> WaitingRooms.Rules.List
  • CreateWaitingRoomRule -> WaitingRooms.Rules.New
  • ReplaceWaitingRoomRules -> WaitingRooms.Rules.Update
  • UpdateWaitingRoomRule -> WaitingRooms.Rules.Edit
  • DeleteWaitingRoomRule -> WaitingRooms.Rules.Delete
  • GetWaitingRoomSettings -> WaitingRooms.Settings.Get
  • PatchWaitingRoomSettings -> WaitingRooms.Settings.Edit
  • UpdateWaitingRoomSettings -> WaitingRooms.Settings.Update
  • ListAccessMutualTLSCertificates -> ZeroTrust.Access.Certificates.List
  • GetAccessMutualTLSCertificate -> ZeroTrust.Access.Certificates.Get
  • CreateAccessMutualTLSCertificate -> ZeroTrust.Access.Certificates.New
  • UpdateAccessMutualTLSCertificate -> ZeroTrust.Access.Certificates.Update
  • DeleteAccessMutualTLSCertificate -> ZeroTrust.Access.Certificates.Delete
  • GetAccessMutualTLSHostnameSettings -> ZeroTrust.Access.Certificates.Settings.List
  • UpdateAccessMutualTLSHostnameSettings -> ZeroTrust.Access.Certificates.Settings.Update
  • FirewallRules -> Firewall.Rules.List
  • FirewallRule -> Firewall.Rules.Get
  • CreateFirewallRules -> Firewall.Rules.New
  • UpdateFirewallRule -> Firewall.Rules.Update
  • UpdateFirewallRules -> Firewall.Rules.Update
  • DeleteFirewallRule -> Firewall.Rules.Delete
  • DeleteFirewallRules -> Firewall.Rules.Delete
  • ListImagesVariants -> Images.V1.Variants.List
  • GetImagesVariant -> Images.V1.Variants.Get
  • CreateImagesVariant -> Images.V1.Variants.New
  • DeleteImagesVariant -> Images.V1.Variants.Delete
  • UpdateImagesVariant -> Images.V1.Variants.Update
  • TeamsLocations -> ZeroTrust.Gateway.Locations.List
  • TeamsLocation -> ZeroTrust.Gateway.Locations.Get
  • CreateTeamsLocation -> ZeroTrust.Gateway.Locations.New
  • UpdateTeamsLocation -> ZeroTrust.Gateway.Locations.Update
  • DeleteTeamsLocation -> ZeroTrust.Gateway.Locations.Delete
  • GetDCVDelegation -> DCVDelegation.UUID.Get
  • ListPrefixes -> Addressing.Prefixes.List
  • GetPrefix -> Addressing.Prefixes.Get
  • UpdatePrefixDescription -> Addressing.Prefixes.Update
  • GetAdvertisementStatus -> Addressing.Prefixes.BGP.Statuses.Get
  • UpdateAdvertisementStatus -> Addressing.Prefixes.BGP.Statuses.Edit
  • ListAccountRoles -> Accounts.Roles.List
  • GetAccountRole -> Accounts.Roles.Get
  • GetUserAuditLogs -> User.AuditLogs.List
  • ListObservatoryPages -> Speed.Pages.List
  • ArgoTunnels -> ZeroTrust.Tunnels.List
  • ArgoTunnel -> ZeroTrust.Tunnels.Get
  • CreateArgoTunnel -> ZeroTrust.Tunnels.New
  • DeleteArgoTunnel -> ZeroTrust.Tunnels.Delete
  • CleanupArgoTunnelConnections -> ZeroTrust.Tunnels.Connections.Delete
  • CreateLogpushJob -> Logpush.Jobs.New
  • ListLogpushJobs -> Logpush.Jobs.List
  • GetLogpushJob -> Logpush.Jobs.Get
  • UpdateLogpushJob -> Logpush.Jobs.Update
  • DeleteLogpushJob -> Logpush.Jobs.Delete
  • ListLogpushJobsForDataset -> Logpush.Datasets.Jobs.Get
  • GetLogpushFields -> Logpush.Datasets.Fields.Get
  • GetLogpushOwnershipChallenge -> Logpush.Ownership.Get
  • ValidateLogpushOwnershipChallenge -> Logpush.Ownership.Validate
  • CheckLogpushDestinationExists -> Logpush.Validate.Destination
  • ListAccessGroups -> ZeroTrust.Access.Groups.List
  • GetAccessGroup -> ZeroTrust.Access.Groups.Get
  • CreateAccessGroup -> ZeroTrust.Access.Groups.New
  • UpdateAccessGroup -> ZeroTrust.Access.Groups.Update
  • DeleteAccessGroup -> ZeroTrust.Access.Groups.Delete
  • ListAccessCustomPages -> ZeroTrust.Access.CustomPages.List
  • GetAccessCustomPage -> ZeroTrust.Access.CustomPages.Get
  • CreateAccessCustomPage -> ZeroTrust.Access.CustomPages.New
  • DeleteAccessCustomPage -> ZeroTrust.Access.CustomPages.Delete
  • UpdateAccessCustomPage -> ZeroTrust.Access.CustomPages.Update
  • GetAuditSSHSettings -> ZeroTrust.Gateway.AuditSSHSettings.Get
  • UpdateAuditSSHSettings -> ZeroTrust.Gateway.AuditSSHSettings.Update
  • ListIPAccessRules -> Firewall.AccessRules.List
  • SpectrumApplications -> Spectrum.Apps.List
  • SpectrumApplication -> Spectrum.Apps.Get
  • CreateSpectrumApplication -> Spectrum.Apps.New
  • UpdateSpectrumApplication -> Spectrum.Apps.Update
  • DeleteSpectrumApplication -> Spectrum.Apps.Delete
  • CreateLoadBalancerPool -> LoadBalancers.Pools.New
  • ListLoadBalancerPools -> LoadBalancers.Poolss.List
  • GetLoadBalancerPool -> LoadBalancers.Pools.Get
  • DeleteLoadBalancerPool -> LoadBalancers.Pools.Delete
  • UpdateLoadBalancerPool -> LoadBalancers.Pools.Update
  • CreateLoadBalancerMonitor -> LoadBalancers.Monitors.New
  • ListLoadBalancerMonitors -> LoadBalancers.Monitorss.List
  • GetLoadBalancerMonitor -> LoadBalancers.Monitors.Get
  • DeleteLoadBalancerMonitor -> LoadBalancers.Monitors.Delete
  • UpdateLoadBalancerMonitor -> LoadBalancers.Monitors.Update
  • CreateLoadBalancer -> LoadBalancers.New
  • ListLoadBalancers -> LoadBalancerss.List
  • GetLoadBalancer -> LoadBalancers.Get
  • DeleteLoadBalancer -> LoadBalancers.Delete
  • UpdateLoadBalancer -> LoadBalancers.Update
  • GetLoadBalancerPoolHealth -> LoadBalancers.Pools.Health
  • CreateWorkersKVNamespace -> KV.Namespaces.New
  • ListWorkersKVNamespaces -> KV.Namespacess.List
  • DeleteWorkersKVNamespace -> KV.Namespaces.Delete
  • UpdateWorkersKVNamespace -> KV.Namespaces.Update
  • WriteWorkersKVEntries -> KV.Namespaces.Bulk.Update
  • DeleteWorkersKVEntries -> KV.Namespaces.Bulk.Delete
  • WriteWorkersKVEntry -> KV.Namespaces.New
  • ListTunnelVirtualNetworks -> ZeroTrust.Networks.VirtualNetworks.List
  • CreateTunnelVirtualNetwork -> ZeroTrust.Networks.VirtualNetworks.New
  • DeleteTunnelVirtualNetwork -> ZeroTrust.Networks.VirtualNetworks.Delete
  • UpdateTunnelVirtualNetwork -> ZeroTrust.Networks.VirtualNetworks.Update
  • ListAccessTags -> ZeroTrust.Access.Tags.List
  • GetAccessTag -> ZeroTrust.Access.Tags.Get
  • CreateAccessTag -> ZeroTrust.Access.Tags.New
  • DeleteAccessTag -> ZeroTrust.Access.Tags.Delete
  • ListPageShieldPolicies -> PageShield.Policies.List
  • CreatePageShieldPolicy -> `Pag

Configuration

📅 Schedule: Branch creation - "on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/github.com-cloudflare-cloudflare-go-2.x branch from 79fdcb0 to e6a5d2b Compare May 9, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant