-
Notifications
You must be signed in to change notification settings - Fork 235
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
Add Zone Subscription Creation #196
Add Zone Subscription Creation #196
Conversation
Consuming the tenant API requires this as a part of the provisioning
$this->adapter = $adapter; | ||
} | ||
|
||
public function addZoneSubscription(string $zoneId, string $ratePlanId = ''): stdClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a little heads up that the method isn't always POST
. see https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/cloudflare/resource_cloudflare_zone.go#L217-L228 for some logic and comments around the behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've matched this with my latest commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacobbednarz thanks for all the feedback! I think I've addressed this, but it would probably be worth you double checking as golang (from your terraform sample) isn't a language I use every day
I copy/pasted this from elsewhere
This will handle updating the subscription regardless of if the subscription exists or not
This isn't supported in <= 7.2, I was using PHP 7.4 to develop this but CI handily highlighted this
} | ||
|
||
$existingSubscription = $this->listZoneSubscriptions($zoneId); | ||
$method = empty($existingSubscription->result) ? 'post' : 'put'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, this is one way of checking it 😛
Consuming the tenant API requires this as a part of the provisioning.
Closes #190