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

Add loadbalancer log subscription #657

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

Tiboau
Copy link
Contributor

@Tiboau Tiboau commented May 24, 2024

Manage log subscription for Loadbalancer

New Feature, add the possibility to the client to subscribe or get information about subscription

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

export OVH_CLOUD_LOADBALANCER_ID_TEST=xxxxxx
export OVH_CLOUD_STREAM_ID_TEST=yyyyy

DataSource

➜  make testacc TESTARGS="-run TestAccCloudProjectLoadBalancerGetLogSubscription_basic"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccCloudProjectLoadBalancerGetLogSubscription_basic -timeout 600m -p 10
?   	github.com/ovh/terraform-provider-ovh	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/helpers	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/types	[no test files]
=== RUN   TestAccCloudProjectLoadBalancerGetLogSubscription_basic
    provider_test.go:398: Read Cloud Project /cloud/project/bad3308a4b4d4dcba4d15d5b082d7225 -> status: 'ok', desc: 'Production'
--- PASS: TestAccCloudProjectLoadBalancerGetLogSubscription_basic (12.58s)
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh	12.595s
testing: warning: no tests to run
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh/helpers/hashcode	(cached) [no tests to run]
make testacc TESTARGS="-run TestAccCloudProjectLoadBalancerGetLogSubscriptions_basic"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccCloudProjectLoadBalancerGetLogSubscriptions_basic -timeout 600m -p 10
?   	github.com/ovh/terraform-provider-ovh	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/helpers	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/types	[no test files]
=== RUN   TestAccCloudProjectLoadBalancerGetLogSubscriptions_basic
    provider_test.go:398: Read Cloud Project /cloud/project/bad3308a4b4d4dcba4d15d5b082d7225 -> status: 'ok', desc: 'Production'
--- PASS: TestAccCloudProjectLoadBalancerGetLogSubscriptions_basic (12.71s)
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh	12.720s
testing: warning: no tests to run
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh/helpers/hashcode	(cached) [no tests to run]

Resource

make testacc TESTARGS="-run TestAccCloudProjectLoadBalancerLogSubscription_basic"      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run TestAccCloudProjectLoadBalancerLogSubscription_basic -timeout 600m -p 10
?   	github.com/ovh/terraform-provider-ovh	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/helpers	[no test files]
?   	github.com/ovh/terraform-provider-ovh/ovh/types	[no test files]
=== RUN   TestAccCloudProjectLoadBalancerLogSubscription_basic
    provider_test.go:398: Read Cloud Project /cloud/project/bad3308a4b4d4dcba4d15d5b082d7225 -> status: 'ok', desc: 'Production'
--- PASS: TestAccCloudProjectLoadBalancerLogSubscription_basic (12.22s)
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh	12.233s
testing: warning: no tests to run
PASS
ok  	github.com/ovh/terraform-provider-ovh/ovh/helpers/hashcode	0.002s [no tests to run]
➜  terraform-provider-ovh git:(add-loadbalancer-log-subscription) ✗ 

Test Configuration:

  • Terraform version: terraform version: Terraform vx.y.z
  • Existing HCL configuration you used:
resource "ovh_cloud_project_region_loadbalancer_log_subscription" "CreateLogSubscription" {
  service_name = "xxxx"
  region_name = "yyyy"
  loadbalancer_id = "aaa"
  kind = "haproxy"
  stream_id = "ssss"
}

data "ovh_cloud_project_region_loadbalancer_log_subscription" "sub" {
   service_name = "xxxx"
   region_name = "yyyy"
   loadbalancer_id = "aaa"
   subscription_id = ovh_cloud_project_region_loadbalancer_log_subscription.CreateLogSubscription.id
}

data "ovh_cloud_project_region_loadbalancer_log_subscriptions" "subs" {
   service_name = "xxxx"
   region_name = "yyyy"
   loadbalancer_id = "aaa"
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I have added acceptance tests that prove my fix is effective or that my feature works

@Tiboau Tiboau force-pushed the add-loadbalancer-log-subscription branch from 9265dd3 to 1fa5e2d Compare June 10, 2024 09:58
@Tiboau Tiboau requested a review from marie-j as a code owner June 10, 2024 09:58
@Tiboau Tiboau force-pushed the add-loadbalancer-log-subscription branch from 17b182b to f4e9760 Compare July 9, 2024 14:58
@Tiboau Tiboau force-pushed the add-loadbalancer-log-subscription branch from c6b47cd to f7de133 Compare July 24, 2024 12:00
@Tiboau Tiboau force-pushed the add-loadbalancer-log-subscription branch from f7de133 to d97fb1e Compare July 25, 2024 06:19
@amstuta amstuta merged commit 0943cd3 into ovh:master Jul 29, 2024
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.

2 participants