diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffcb7347..08d23338 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Create Release id: create_release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6249d70..cdb309b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,20 +10,12 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v1 - - - name: Cache modules - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + uses: actions/checkout@v4 - name: Format if: matrix.platform == 'ubuntu-latest' diff --git a/v2/ecl/managed_load_balancer/v1/certificates/doc.go b/v2/ecl/managed_load_balancer/v1/certificates/doc.go index 02633bcd..52cb294d 100644 --- a/v2/ecl/managed_load_balancer/v1/certificates/doc.go +++ b/v2/ecl/managed_load_balancer/v1/certificates/doc.go @@ -89,8 +89,9 @@ Example to delete a certificate Example to upload a certificate file uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", + Type: "ssl-key", Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2R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BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVYKV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWApZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaCmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWIKY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZAplZmdoaWprbG1ub3BxcnN0dXZ3eHl6VjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlCmZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + Passphrase: "passphrase", } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" diff --git a/v2/ecl/managed_load_balancer/v1/certificates/requests.go b/v2/ecl/managed_load_balancer/v1/certificates/requests.go index dd5946c1..0d115ff4 100644 --- a/v2/ecl/managed_load_balancer/v1/certificates/requests.go +++ b/v2/ecl/managed_load_balancer/v1/certificates/requests.go @@ -17,16 +17,19 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - ID of the owner tenant of the resource TenantID string `q:"tenant_id"` + // - If `true` is set, information of the certificate file are displayed + Details bool `q:"details"` + // - CA certificate file upload status of the certificate CACertStatus string `q:"ca_cert_status"` @@ -76,17 +79,18 @@ Create Certificate type CreateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` } @@ -137,17 +141,18 @@ Update Certificate type UpdateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -202,11 +207,19 @@ type UploadFileOpts struct { Type string `json:"type"` // - Content of the certificate file to be uploaded - // - Content must be Base64 encoded + // - The content must be Base64 encoded // - The file size before encoding must be less than or equal to 16KB // - The file format before encoding must be PEM - // - DER can be converted to PEM by using OpenSSL command + // - DER can be converted to PEM by using OpenSSL command + // - The following key algorithms are supported + // - RSA 1024, 2048, 3072 and 4096 bits + // - ECDSA P-256 (prime256v1, secp256r1), P-384 (secp384r1) and P-521 (secp521r1) + // - The content of `"ssl-cert"` and the content of `"ssl-key"` must be a pair (must be matched correctly) Content string `json:"content"` + + // - Passphrase of the certificate file to be uploaded + // - This parameter can be set when 'type' is `"ssl-key"` + Passphrase string `json:"passphrase,omitempty"` } // ToCertificateUploadFileMap builds a request body from UploadFileOpts. diff --git a/v2/ecl/managed_load_balancer/v1/certificates/results.go b/v2/ecl/managed_load_balancer/v1/certificates/results.go index 2d3170ab..94101e01 100644 --- a/v2/ecl/managed_load_balancer/v1/certificates/results.go +++ b/v2/ecl/managed_load_balancer/v1/certificates/results.go @@ -44,6 +44,29 @@ type FileInResponse struct { // - File upload status of the certificate Status string `json:"status"` + + // - Information of the certificate file (JSON object format) + // - When List Certificates + // - If `details` is `true`, return object + // - When Create, Show, and Update Certificate + // - Always return object + // - For example, the following fields would be included + // - When ca_cert or ssl_cert + // - `"issuer"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"subject"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"not_before"` and `"not_after"` + // - Format: `"%Y-%m-%d %H:%M:%S"` (UTC) + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"serial"` + // - `"fingerprint"` (SHA-256) + // - When ssl_key + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"passphrase"` ( `true` or `false` ) + Info map[string]interface{} `json:"info"` } // Certificate represents a certificate. diff --git a/v2/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go b/v2/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go index aa565e7e..fb742e00 100644 --- a/v2/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go +++ b/v2/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go @@ -21,13 +21,59 @@ var listResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } ] @@ -36,19 +82,53 @@ var listResponse = fmt.Sprintf(` func listResult() []certificates.Certificate { var certificate1 certificates.Certificate + var sslKey1Info map[string]interface{} + sslKey1InfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKey1InfoJson), &sslKey1Info) + if err != nil { + panic(err) + } + sslKey1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKey1Info, + } + + var sslCert1Info map[string]interface{} + sslCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCert1InfoJson), &sslCert1Info) + if err != nil { + panic(err) } + sslCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCert1Info, } + + var caCert1Info map[string]interface{} + caCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCert1InfoJson), &caCert1Info) + if err != nil { + panic(err) + } + caCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCert1Info, } var tags1 map[string]interface{} tags1Json := `{"key":"value"}` - err := json.Unmarshal([]byte(tags1Json), &tags1) + err = json.Unmarshal([]byte(tags1Json), &tags1) if err != nil { panic(err) } @@ -87,13 +167,16 @@ var createResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} } } }`) @@ -101,19 +184,45 @@ var createResponse = fmt.Sprintf(` func createResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -141,13 +250,59 @@ var showResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -155,19 +310,53 @@ var showResponse = fmt.Sprintf(` func showResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) + } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -206,13 +395,59 @@ var updateResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -220,19 +455,53 @@ var updateResponse = fmt.Sprintf(` func updateResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, + } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -251,6 +520,7 @@ func updateResult() *certificates.Certificate { var uploadFileRequest = fmt.Sprintf(` { - "type": "ca-cert", - "content": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRgpHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdICklKS0xNTk9QU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load_balancer/v1/certificates/testing/requests_test.go b/v2/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go index b46bcbe4..501a8a0a 100644 --- a/v2/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go +++ b/v2/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go @@ -205,8 +205,9 @@ func TestUploadFileCertificate(t *testing.T) { cli := ServiceClient() uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", - Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRgpHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ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passphrase: "passphrase", } err := certificates.UploadFile(cli, id, uploadFileOpts).ExtractErr() diff --git a/v2/ecl/managed_load_balancer/v1/health_monitors/requests.go b/v2/ecl/managed_load_balancer/v1/health_monitors/requests.go index 1992ae73..92b85d85 100644 --- a/v2/ecl/managed_load_balancer/v1/health_monitors/requests.go +++ b/v2/ecl/managed_load_balancer/v1/health_monitors/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -99,17 +99,18 @@ Create Health Monitor type CreateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Port number of the health monitor for healthchecking @@ -220,17 +221,18 @@ Update Health Monitor Attributes type UpdateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } diff --git a/v2/ecl/managed_load_balancer/v1/health_monitors/results.go b/v2/ecl/managed_load_balancer/v1/health_monitors/results.go index fc1b20fb..4c626355 100644 --- a/v2/ecl/managed_load_balancer/v1/health_monitors/results.go +++ b/v2/ecl/managed_load_balancer/v1/health_monitors/results.go @@ -112,6 +112,8 @@ type HealthMonitor struct { // - Changed configurations of the health monitor exists that waiting to be applied // - `"DELETE_STAGED"` // - The health monitor has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the health monitor belongs to @@ -132,6 +134,8 @@ type HealthMonitor struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the health monitor belongs to diff --git a/v2/ecl/managed_load_balancer/v1/listeners/requests.go b/v2/ecl/managed_load_balancer/v1/listeners/requests.go index 17201f33..a14a1092 100644 --- a/v2/ecl/managed_load_balancer/v1/listeners/requests.go +++ b/v2/ecl/managed_load_balancer/v1/listeners/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -85,23 +85,31 @@ Create Listener type CreateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the listener for listening @@ -188,17 +196,18 @@ Update Listener Attribute type UpdateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -249,9 +258,16 @@ Create Staged Listener Configurations type CreateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address,omitempty"` // - Port number of the listener for listening @@ -309,9 +325,16 @@ Update Staged Listener Configurations type UpdateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address,omitempty"` // - Port number of the listener for listening diff --git a/v2/ecl/managed_load_balancer/v1/listeners/results.go b/v2/ecl/managed_load_balancer/v1/listeners/results.go index 5fa0657b..dd48808e 100644 --- a/v2/ecl/managed_load_balancer/v1/listeners/results.go +++ b/v2/ecl/managed_load_balancer/v1/listeners/results.go @@ -94,6 +94,8 @@ type Listener struct { // - Changed configurations of the listener exists that waiting to be applied // - `"DELETE_STAGED"` // - The listener has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the listener belongs to @@ -114,6 +116,8 @@ type Listener struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the listener belongs to diff --git a/v2/ecl/managed_load_balancer/v1/load_balancers/requests.go b/v2/ecl/managed_load_balancer/v1/load_balancers/requests.go index 6809ae83..7d578c0e 100644 --- a/v2/ecl/managed_load_balancer/v1/load_balancers/requests.go +++ b/v2/ecl/managed_load_balancer/v1/load_balancers/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -92,9 +92,16 @@ type CreateOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -104,18 +111,26 @@ type CreateOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy - ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateOptsSyslogServer represents syslog_server information in the load balancer creation. @@ -137,21 +152,22 @@ type CreateOptsSyslogServer struct { type CreateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the plan - PlanID string `json:"plan_id,omitempty"` + PlanID string `json:"plan_id"` // - Syslog servers to which access logs are transferred // - The facility code of syslog is 0 (kern), and the severity level is 6 (info) @@ -166,7 +182,7 @@ type CreateOpts struct { // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed - Interfaces *[]CreateOptsInterface `json:"interfaces,omitempty"` + Interfaces *[]CreateOptsInterface `json:"interfaces"` } // ToLoadBalancerCreateMap builds a request body from CreateOpts. @@ -242,17 +258,18 @@ Update Load Balancer Attributes type UpdateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -368,9 +385,16 @@ type CreateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -380,20 +404,28 @@ type CreateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateStagedOptsSyslogServer represents syslog_server information in the load balancer configurations creation. @@ -478,9 +510,16 @@ type UpdateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` } @@ -490,20 +529,28 @@ type UpdateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID *string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress *string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // UpdateStagedOptsSyslogServer represents syslog_server information in load balancer configurations updation. diff --git a/v2/ecl/managed_load_balancer/v1/load_balancers/results.go b/v2/ecl/managed_load_balancer/v1/load_balancers/results.go index aa34a4e0..4eb68cf4 100644 --- a/v2/ecl/managed_load_balancer/v1/load_balancers/results.go +++ b/v2/ecl/managed_load_balancer/v1/load_balancers/results.go @@ -138,6 +138,8 @@ type LoadBalancer struct { // - The load balancer has been added and waiting to be applied // - `"UPDATE_STAGED"` // - Changed configurations of the load balancer exists that waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Monitoring status of the load balancer @@ -167,6 +169,8 @@ type LoadBalancer struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - The zone / group where the primary virtual server of load balancer is deployed diff --git a/v2/ecl/managed_load_balancer/v1/plans/requests.go b/v2/ecl/managed_load_balancer/v1/plans/requests.go index 4f4bf320..a2af323a 100644 --- a/v2/ecl/managed_load_balancer/v1/plans/requests.go +++ b/v2/ecl/managed_load_balancer/v1/plans/requests.go @@ -48,15 +48,18 @@ type ListOpts struct { // - Maximum number of target groups for the plan MaxNumberOfTargetGroups int `q:"max_number_of_target_groups"` - // - Maximum number of members for the target group of plan + // - Maximum number of members for the target group of the plan MaxNumberOfMembers int `q:"max_number_of_members"` - // - Maximum number of rules for the policy of plan + // - Maximum number of rules for the policy of the plan MaxNumberOfRules int `q:"max_number_of_rules"` // - Maximum number of conditions in the rule of the plan MaxNumberOfConditions int `q:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) for the policy of the plan + MaxNumberOfServerNameInidications int `q:"max_number_of_server_name_inidications"` + // - Whether a new load balancer can be created with this plan Enabled bool `q:"enabled"` } diff --git a/v2/ecl/managed_load_balancer/v1/plans/results.go b/v2/ecl/managed_load_balancer/v1/plans/results.go index e1b6345f..725b53d7 100644 --- a/v2/ecl/managed_load_balancer/v1/plans/results.go +++ b/v2/ecl/managed_load_balancer/v1/plans/results.go @@ -27,39 +27,42 @@ type Plan struct { // - Description of the plan Description string `json:"description"` - // - Bandwidth of the load balancer created with this plan + // - Bandwidth of the load balancer Bandwidth string `json:"bandwidth"` - // - Redundancy of the load balancer created with this plan + // - Redundancy of the load balancer Redundancy string `json:"redundancy"` - // - Maximum number of interfaces for the load balancer created with this plan + // - Maximum number of interfaces for the load balancer MaxNumberOfInterfaces int `json:"max_number_of_interfaces"` - // - Maximum number of health monitors for the load balancer created with this plan + // - Maximum number of health monitors for the load balancer MaxNumberOfHealthMonitors int `json:"max_number_of_health_monitors"` - // - Maximum number of listeners for the load balancer created with this plan + // - Maximum number of listeners for the load balancer MaxNumberOfListeners int `json:"max_number_of_listeners"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of policies for the load balancer MaxNumberOfPolicies int `json:"max_number_of_policies"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of routes for the load balancer MaxNumberOfRoutes int `json:"max_number_of_routes"` - // - Maximum number of target groups for the load balancer created with this plan + // - Maximum number of target groups for the load balancer MaxNumberOfTargetGroups int `json:"max_number_of_target_groups"` - // - Maximum number of members for the target group of load balancer created with this plan + // - Maximum number of members for a target group MaxNumberOfMembers int `json:"max_number_of_members"` - // - Maximum number of rules for the policy of load balancer created with this plan + // - Maximum number of rules for a policy MaxNumberOfRules int `json:"max_number_of_rules"` - // - Maximum number of conditions in the rule of load balancer created with this plan + // - Maximum number of conditions in a rule MaxNumberOfConditions int `json:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) in a policy + MaxNumberOfServerNameIndications int `json:"max_number_of_server_name_indications"` + // - Whether a new load balancer can be created with this plan Enabled bool `json:"enabled"` } diff --git a/v2/ecl/managed_load_balancer/v1/plans/testing/fixtures.go b/v2/ecl/managed_load_balancer/v1/plans/testing/fixtures.go index 20389d64..15014fe6 100644 --- a/v2/ecl/managed_load_balancer/v1/plans/testing/fixtures.go +++ b/v2/ecl/managed_load_balancer/v1/plans/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } ] @@ -48,6 +49,7 @@ func listResult() []plans.Plan { plan1.MaxNumberOfMembers = 100 plan1.MaxNumberOfRules = 50 plan1.MaxNumberOfConditions = 5 + plan1.MaxNumberOfServerNameIndications = 50 plan1.Enabled = true return []plans.Plan{plan1} @@ -70,6 +72,7 @@ var showResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } }`) @@ -91,6 +94,7 @@ func showResult() *plans.Plan { plan.MaxNumberOfMembers = 100 plan.MaxNumberOfRules = 50 plan.MaxNumberOfConditions = 5 + plan.MaxNumberOfServerNameIndications = 50 plan.Enabled = true return &plan diff --git a/v2/ecl/managed_load_balancer/v1/policies/doc.go b/v2/ecl/managed_load_balancer/v1/policies/doc.go index a804c5df..0cc168b0 100644 --- a/v2/ecl/managed_load_balancer/v1/policies/doc.go +++ b/v2/ecl/managed_load_balancer/v1/policies/doc.go @@ -21,6 +21,12 @@ Example to list policies Example to create a policy + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -35,13 +41,16 @@ Example to create a policy Tags: tags, Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } @@ -101,16 +110,25 @@ Example to delete a policy Example to create staged policy configurations + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } @@ -134,8 +152,20 @@ Example to show staged policy configurations Example to update staged policy configurations + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -143,17 +173,21 @@ Example to update staged policy configurations healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ Algorithm: &algorithm, Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, IdleTimeout: &idleTimeout, SorryPageUrl: &sorryPageUrl, SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: &certificateID, HealthMonitorID: &healthMonitorID, ListenerID: &listenerID, DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, TLSPolicyID: &tlsPolicyID, } diff --git a/v2/ecl/managed_load_balancer/v1/policies/requests.go b/v2/ecl/managed_load_balancer/v1/policies/requests.go index 1c610983..dbdeb08b 100644 --- a/v2/ecl/managed_load_balancer/v1/policies/requests.go +++ b/v2/ecl/managed_load_balancer/v1/policies/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -36,7 +36,13 @@ type ListOpts struct { // - Persistence setting of the policy Persistence string `q:"persistence"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + PersistenceTimeout int `q:"persistence_timeout"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive IdleTimeout int `q:"idle_timeout"` // - URL of the sorry page to which accesses are redirected if all members in the target group are down @@ -46,6 +52,7 @@ type ListOpts struct { SourceNat string `q:"source_nat"` // - ID of the certificate that assigned to the policy + // - Also includes certificate contained in `server_name_indications` CertificateID string `q:"certificate_id"` // - ID of the health monitor that assigned to the policy @@ -57,6 +64,10 @@ type ListOpts struct { // - ID of the default target group that assigned to the policy DefaultTargetGroupID string `q:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the TLS policy that assigned to the policy TLSPolicyID string `q:"tls_policy_id"` @@ -102,21 +113,45 @@ func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { Create Policy */ +// CreateOptsServerNameIndication represents server_name_indication information in the policy creation. +type CreateOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateOpts represents options used to create a new policy. type CreateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Load balancing algorithm (method) of the policy @@ -126,16 +161,29 @@ type CreateOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -146,10 +194,17 @@ type CreateOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -162,9 +217,24 @@ type CreateOpts struct { ListenerID string `json:"listener_id"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -248,17 +318,18 @@ Update Policy Attributes type UpdateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -305,6 +376,29 @@ func Delete(c *eclcloud.ServiceClient, id string) (r DeleteResult) { Create Staged Policy Configurations */ +// CreateStagedOptsServerNameIndication represents server_name_indication information in the policy configurations creation. +type CreateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateStagedOpts represents options used to create new policy configurations. type CreateStagedOpts struct { @@ -315,16 +409,29 @@ type CreateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -336,11 +443,18 @@ type CreateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -353,9 +467,24 @@ type CreateStagedOpts struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -407,6 +536,29 @@ func ShowStaged(c *eclcloud.ServiceClient, id string) (r ShowStagedResult) { Update Staged Policy Configurations */ +// UpdateStagedOptsServerNameIndication represents server_name_indication information in policy configurations updation. +type UpdateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName *string `json:"server_name"` + + // - You can choice the input type of the server name + InputType *string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority *int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID *string `json:"certificate_id"` +} + // UpdateStagedOpts represents options used to update existing Policy configurations. type UpdateStagedOpts struct { @@ -417,16 +569,29 @@ type UpdateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence *string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout *int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout *int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -438,11 +603,18 @@ type UpdateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat *string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]UpdateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID *string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -455,9 +627,24 @@ type UpdateStagedOpts struct { ListenerID *string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID *string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set diff --git a/v2/ecl/managed_load_balancer/v1/policies/results.go b/v2/ecl/managed_load_balancer/v1/policies/results.go index d7c8ca0e..290bd776 100644 --- a/v2/ecl/managed_load_balancer/v1/policies/results.go +++ b/v2/ecl/managed_load_balancer/v1/policies/results.go @@ -67,16 +67,27 @@ type ConfigurationInResponse struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -86,6 +97,11 @@ type ConfigurationInResponse struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -97,13 +113,41 @@ type ConfigurationInResponse struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` } +// ServerNameIndicationInResponse represents a server name indication in a policy. +type ServerNameIndicationInResponse struct { + + // - The server name of Server Name Indication (SNI) + ServerName string `json:"server_name"` + + // - Input type of the server name + // - Default value is `"fixed"` + InputType string `json:"input_type"` + + // - Priority of Server Name Indication (SNI) + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + CertificateID string `json:"certificate_id"` +} + // Policy represents a policy. type Policy struct { @@ -128,6 +172,8 @@ type Policy struct { // - Changed configurations of the policy exists that waiting to be applied // - `"DELETE_STAGED"` // - The policy has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the policy belongs to @@ -148,6 +194,8 @@ type Policy struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the policy belongs to @@ -163,16 +211,27 @@ type Policy struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -182,6 +241,11 @@ type Policy struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -193,8 +257,19 @@ type Policy struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` diff --git a/v2/ecl/managed_load_balancer/v1/policies/testing/fixtures.go b/v2/ecl/managed_load_balancer/v1/policies/testing/fixtures.go index 07acbae9..3ccb7058 100644 --- a/v2/ecl/managed_load_balancer/v1/policies/testing/fixtures.go +++ b/v2/ecl/managed_load_balancer/v1/policies/testing/fixtures.go @@ -25,13 +25,23 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } ] @@ -40,6 +50,13 @@ var listResponse = fmt.Sprintf(` func listResult() []policies.Policy { var policy1 policies.Policy + serverNameIndication11 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + var tags1 map[string]interface{} tags1Json := `{"key":"value"}` err := json.Unmarshal([]byte(tags1Json), &tags1) @@ -57,13 +74,16 @@ func listResult() []policies.Policy { policy1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy1.Algorithm = "round-robin" policy1.Persistence = "cookie" + policy1.PersistenceTimeout = 525600 policy1.IdleTimeout = 600 policy1.SorryPageUrl = "https://example.com/sorry" policy1.SourceNat = "enable" + policy1.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication11} policy1.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy1.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy1.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy1.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy1.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy1.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return []policies.Policy{policy1} @@ -79,13 +99,23 @@ var createRequest = fmt.Sprintf(` }, "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "load_balancer_id": "67fea379-cff0-4191-9175-de7d6941a040" } @@ -106,13 +136,16 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -137,13 +170,16 @@ func createResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -164,24 +200,44 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "current": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" }, "staged": null @@ -191,18 +247,27 @@ var showResponse = fmt.Sprintf(` func showResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var staged policies.ConfigurationInResponse current := policies.ConfigurationInResponse{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: []policies.ServerNameIndicationInResponse{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } var tags map[string]interface{} @@ -222,13 +287,16 @@ func showResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" policy.Current = current policy.Staged = staged @@ -262,13 +330,16 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -293,13 +364,16 @@ func updateResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -310,13 +384,23 @@ var createStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -326,13 +410,23 @@ var createStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -340,15 +434,25 @@ var createStagedResponse = fmt.Sprintf(` func createStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -359,13 +463,23 @@ var showStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -373,15 +487,25 @@ var showStagedResponse = fmt.Sprintf(` func showStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -392,13 +516,23 @@ var updateStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -408,13 +542,23 @@ var updateStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -422,15 +566,25 @@ var updateStagedResponse = fmt.Sprintf(` func updateStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy diff --git a/v2/ecl/managed_load_balancer/v1/policies/testing/requests_test.go b/v2/ecl/managed_load_balancer/v1/policies/testing/requests_test.go index 563840a1..9d2d1202 100644 --- a/v2/ecl/managed_load_balancer/v1/policies/testing/requests_test.go +++ b/v2/ecl/managed_load_balancer/v1/policies/testing/requests_test.go @@ -81,6 +81,12 @@ func TestCreatePolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -89,20 +95,23 @@ func TestCreatePolicy(t *testing.T) { th.AssertNoErr(t, err) createOpts := policies.CreateOpts{ - Name: "policy", - Description: "description", - Tags: tags, - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", - LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", + Name: "policy", + Description: "description", + Tags: tags, + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } actual, err := policies.Create(cli, createOpts).Extract() @@ -218,17 +227,26 @@ func TestCreateStagedPolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } actual, err := policies.CreateStaged(cli, id, createStagedOpts).Extract() @@ -281,8 +299,20 @@ func TestUpdateStagedPolicy(t *testing.T) { cli := ServiceClient() + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -290,18 +320,22 @@ func TestUpdateStagedPolicy(t *testing.T) { healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ - Algorithm: &algorithm, - Persistence: &persistence, - IdleTimeout: &idleTimeout, - SorryPageUrl: &sorryPageUrl, - SourceNat: &sourceNat, - CertificateID: &certificateID, - HealthMonitorID: &healthMonitorID, - ListenerID: &listenerID, - DefaultTargetGroupID: &defaultTargetGroupID, - TLSPolicyID: &tlsPolicyID, + Algorithm: &algorithm, + Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, + IdleTimeout: &idleTimeout, + SorryPageUrl: &sorryPageUrl, + SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: &certificateID, + HealthMonitorID: &healthMonitorID, + ListenerID: &listenerID, + DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + TLSPolicyID: &tlsPolicyID, } actual, err := policies.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v2/ecl/managed_load_balancer/v1/routes/requests.go b/v2/ecl/managed_load_balancer/v1/routes/requests.go index c2c746ae..50f27c7f 100644 --- a/v2/ecl/managed_load_balancer/v1/routes/requests.go +++ b/v2/ecl/managed_load_balancer/v1/routes/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -82,17 +82,18 @@ Create Route type CreateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - CIDR of destination for the (static) route @@ -101,12 +102,19 @@ type CreateOpts struct { // - If you want to change `destination_cidr`, recreate the (static) route again // - Set a unique CIDR for all (static) routes which belong to the same load balancer // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a link-local CIDR (RFC 3927) which includes Common Function Gateway + // - Cannot use a CIDR in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) DestinationCidr string `json:"destination_cidr"` - // - ID of the load balancer which the (static) route belongs to - // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - IP address of next hop for the (static) route + // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address"` // - ID of the load balancer which the (static) route belongs to @@ -186,17 +194,18 @@ Update Route Attributes type UpdateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -246,9 +255,9 @@ Create Staged Route Configurations // CreateStagedOpts represents options used to create new route configurations. type CreateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address,omitempty"` } @@ -298,9 +307,9 @@ Update Staged Route Configurations // UpdateStagedOpts represents options used to update existing Route configurations. type UpdateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress *string `json:"next_hop_ip_address,omitempty"` } diff --git a/v2/ecl/managed_load_balancer/v1/routes/results.go b/v2/ecl/managed_load_balancer/v1/routes/results.go index 13e5be2f..66a12429 100644 --- a/v2/ecl/managed_load_balancer/v1/routes/results.go +++ b/v2/ecl/managed_load_balancer/v1/routes/results.go @@ -88,6 +88,8 @@ type Route struct { // - Changed configurations of the (static) route exists that waiting to be applied // - `"DELETE_STAGED"` // - The (static) route has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the (static) route belongs to @@ -108,6 +110,8 @@ type Route struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - CIDR of destination for the (static) route diff --git a/v2/ecl/managed_load_balancer/v1/rules/doc.go b/v2/ecl/managed_load_balancer/v1/rules/doc.go index 1356c598..68ba767c 100644 --- a/v2/ecl/managed_load_balancer/v1/rules/doc.go +++ b/v2/ecl/managed_load_balancer/v1/rules/doc.go @@ -38,6 +38,7 @@ Example to create a rule Tags: tags, Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", Conditions: &condition, } @@ -103,6 +104,7 @@ Example to create staged rule configurations createStagedOpts := rules.CreateStagedOpts{ Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", Conditions: &condition, } @@ -132,9 +134,11 @@ Example to update staged rule configurations priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ Priority: &priority, TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, Conditions: &condition, } diff --git a/v2/ecl/managed_load_balancer/v1/rules/requests.go b/v2/ecl/managed_load_balancer/v1/rules/requests.go index d465080a..aeb4507f 100644 --- a/v2/ecl/managed_load_balancer/v1/rules/requests.go +++ b/v2/ecl/managed_load_balancer/v1/rules/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -34,8 +34,14 @@ type ListOpts struct { Priority int `q:"priority"` // - ID of the target group that assigned to the rule + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy TargetGroupID string `q:"target_group_id"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group are down, traffic is routed to the backup target group + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the policy which the rule belongs to PolicyID string `q:"policy_id"` @@ -95,34 +101,47 @@ type CreateOptsCondition struct { type CreateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy - TargetGroupID string `json:"target_group_id,omitempty"` + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + TargetGroupID string `json:"target_group_id"` + + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` // - ID of the policy which the rule belongs to // - Set ID of the policy which has a listener in which protocol is either `"http"` or `"https"` - PolicyID string `json:"policy_id,omitempty"` + PolicyID string `json:"policy_id"` // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition - Conditions *CreateOptsCondition `json:"conditions,omitempty"` + Conditions *CreateOptsCondition `json:"conditions"` } // ToRuleCreateMap builds a request body from CreateOpts. @@ -198,17 +217,18 @@ Update Rule Attributes type UpdateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -269,13 +289,25 @@ type CreateStagedOptsCondition struct { type CreateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *CreateStagedOptsCondition `json:"conditions,omitempty"` @@ -338,13 +370,25 @@ type UpdateStagedOptsCondition struct { type UpdateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority *int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID *string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *UpdateStagedOptsCondition `json:"conditions,omitempty"` diff --git a/v2/ecl/managed_load_balancer/v1/rules/results.go b/v2/ecl/managed_load_balancer/v1/rules/results.go index 2dddb178..732924e7 100644 --- a/v2/ecl/managed_load_balancer/v1/rules/results.go +++ b/v2/ecl/managed_load_balancer/v1/rules/results.go @@ -64,8 +64,16 @@ type ConfigurationInResponse struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` } @@ -101,6 +109,8 @@ type Rule struct { // - Changed configurations of the rule exists that waiting to be applied // - `"DELETE_STAGED"` // - The rule has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the rule belongs to @@ -121,6 +131,8 @@ type Rule struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the policy which the rule belongs to @@ -136,8 +148,16 @@ type Rule struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` diff --git a/v2/ecl/managed_load_balancer/v1/rules/testing/fixtures.go b/v2/ecl/managed_load_balancer/v1/rules/testing/fixtures.go index 6ef736ed..63b963f6 100644 --- a/v2/ecl/managed_load_balancer/v1/rules/testing/fixtures.go +++ b/v2/ecl/managed_load_balancer/v1/rules/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -60,6 +61,7 @@ func listResult() []rules.Rule { rule1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule1.Priority = 1 rule1.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule1.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule1.Conditions = condition1 return []rules.Rule{rule1} @@ -76,6 +78,7 @@ var createRequest = fmt.Sprintf(` "policy_id": "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -100,6 +103,7 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -127,6 +131,7 @@ func createResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -148,6 +153,7 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -156,6 +162,7 @@ var showResponse = fmt.Sprintf(` "current": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -174,9 +181,10 @@ func showResult() *rules.Rule { } var staged rules.ConfigurationInResponse current := rules.ConfigurationInResponse{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: condition, } var tags map[string]interface{} @@ -197,6 +205,7 @@ func showResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition rule.Current = current rule.Staged = staged @@ -231,6 +240,7 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -258,6 +268,7 @@ func updateResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -268,6 +279,7 @@ var createStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -281,6 +293,7 @@ var createStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -298,6 +311,7 @@ func createStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -308,6 +322,7 @@ var showStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -325,6 +340,7 @@ func showStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -335,6 +351,7 @@ var updateStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -348,6 +365,7 @@ var updateStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -365,6 +383,7 @@ func updateStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule diff --git a/v2/ecl/managed_load_balancer/v1/rules/testing/requests_test.go b/v2/ecl/managed_load_balancer/v1/rules/testing/requests_test.go index 0168a598..5f1d8580 100644 --- a/v2/ecl/managed_load_balancer/v1/rules/testing/requests_test.go +++ b/v2/ecl/managed_load_balancer/v1/rules/testing/requests_test.go @@ -92,13 +92,14 @@ func TestCreateRule(t *testing.T) { th.AssertNoErr(t, err) createOpts := rules.CreateOpts{ - Name: "rule", - Description: "description", - Tags: tags, - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", - Conditions: &condition, + Name: "rule", + Description: "description", + Tags: tags, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", + Conditions: &condition, } actual, err := rules.Create(cli, createOpts).Extract() @@ -218,9 +219,10 @@ func TestCreateStagedRule(t *testing.T) { PathPatterns: []string{"^/statics/"}, } createStagedOpts := rules.CreateStagedOpts{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: &condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: &condition, } actual, err := rules.CreateStaged(cli, id, createStagedOpts).Extract() @@ -279,10 +281,12 @@ func TestUpdateStagedRule(t *testing.T) { priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ - Priority: &priority, - TargetGroupID: &targetGroupID, - Conditions: &condition, + Priority: &priority, + TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + Conditions: &condition, } actual, err := rules.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v2/ecl/managed_load_balancer/v1/target_groups/requests.go b/v2/ecl/managed_load_balancer/v1/target_groups/requests.go index 3ae6ecd2..4e644de2 100644 --- a/v2/ecl/managed_load_balancer/v1/target_groups/requests.go +++ b/v2/ecl/managed_load_balancer/v1/target_groups/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -76,14 +76,21 @@ Create Target Group type CreateOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -96,24 +103,25 @@ type CreateOptsMember struct { type CreateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the load balancer which the target group belongs to - LoadBalancerID string `json:"load_balancer_id,omitempty"` + LoadBalancerID string `json:"load_balancer_id"` // - Members (real servers) of the target group - Members *[]CreateOptsMember `json:"members,omitempty"` + Members *[]CreateOptsMember `json:"members"` } // ToTargetGroupCreateMap builds a request body from CreateOpts. @@ -189,17 +197,18 @@ Update Target Group Attributes type UpdateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -250,14 +259,21 @@ Create Staged Target Group Configurations type CreateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -320,14 +336,21 @@ Update Staged Target Group Configurations type UpdateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port *int `json:"port"` // - Weight for the member (real server) diff --git a/v2/ecl/managed_load_balancer/v1/target_groups/results.go b/v2/ecl/managed_load_balancer/v1/target_groups/results.go index 421b4dfc..5e0a507e 100644 --- a/v2/ecl/managed_load_balancer/v1/target_groups/results.go +++ b/v2/ecl/managed_load_balancer/v1/target_groups/results.go @@ -102,6 +102,8 @@ type TargetGroup struct { // - Changed configurations of the target group exists that waiting to be applied // - `"DELETE_STAGED"` // - The target group has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the target group belongs to @@ -122,6 +124,8 @@ type TargetGroup struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the target group belongs to diff --git a/v3/ecl/managed_load_balancer/v1/certificates/doc.go b/v3/ecl/managed_load_balancer/v1/certificates/doc.go index 02633bcd..52cb294d 100644 --- a/v3/ecl/managed_load_balancer/v1/certificates/doc.go +++ b/v3/ecl/managed_load_balancer/v1/certificates/doc.go @@ -89,8 +89,9 @@ Example to delete a certificate Example to upload a certificate file uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", + Type: "ssl-key", Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3OD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E1OT1BRUlNUClVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVYKV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWApZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaCmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWIKY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZAplZmdoaWprbG1ub3BxcnN0dXZ3eHl6VjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlCmZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + Passphrase: "passphrase", } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" diff --git a/v3/ecl/managed_load_balancer/v1/certificates/requests.go b/v3/ecl/managed_load_balancer/v1/certificates/requests.go index 39a3149d..bc498d99 100644 --- a/v3/ecl/managed_load_balancer/v1/certificates/requests.go +++ b/v3/ecl/managed_load_balancer/v1/certificates/requests.go @@ -17,16 +17,19 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - ID of the owner tenant of the resource TenantID string `q:"tenant_id"` + // - If `true` is set, information of the certificate file are displayed + Details bool `q:"details"` + // - CA certificate file upload status of the certificate CACertStatus string `q:"ca_cert_status"` @@ -76,17 +79,18 @@ Create Certificate type CreateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` } @@ -137,17 +141,18 @@ Update Certificate type UpdateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -202,11 +207,19 @@ type UploadFileOpts struct { Type string `json:"type"` // - Content of the certificate file to be uploaded - // - Content must be Base64 encoded + // - The content must be Base64 encoded // - The file size before encoding must be less than or equal to 16KB // - The file format before encoding must be PEM - // - DER can be converted to PEM by using OpenSSL command + // - DER can be converted to PEM by using OpenSSL command + // - The following key algorithms are supported + // - RSA 1024, 2048, 3072 and 4096 bits + // - ECDSA P-256 (prime256v1, secp256r1), P-384 (secp384r1) and P-521 (secp521r1) + // - The content of `"ssl-cert"` and the content of `"ssl-key"` must be a pair (must be matched correctly) Content string `json:"content"` + + // - Passphrase of the certificate file to be uploaded + // - This parameter can be set when 'type' is `"ssl-key"` + Passphrase string `json:"passphrase,omitempty"` } // ToCertificateUploadFileMap builds a request body from UploadFileOpts. diff --git a/v3/ecl/managed_load_balancer/v1/certificates/results.go b/v3/ecl/managed_load_balancer/v1/certificates/results.go index 3d8caee3..107f95a3 100644 --- a/v3/ecl/managed_load_balancer/v1/certificates/results.go +++ b/v3/ecl/managed_load_balancer/v1/certificates/results.go @@ -44,6 +44,29 @@ type FileInResponse struct { // - File upload status of the certificate Status string `json:"status"` + + // - Information of the certificate file (JSON object format) + // - When List Certificates + // - If `details` is `true`, return object + // - When Create, Show, and Update Certificate + // - Always return object + // - For example, the following fields would be included + // - When ca_cert or ssl_cert + // - `"issuer"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"subject"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"not_before"` and `"not_after"` + // - Format: `"%Y-%m-%d %H:%M:%S"` (UTC) + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"serial"` + // - `"fingerprint"` (SHA-256) + // - When ssl_key + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"passphrase"` ( `true` or `false` ) + Info map[string]interface{} `json:"info"` } // Certificate represents a certificate. diff --git a/v3/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go b/v3/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go index e994a2a0..b00c4bf0 100644 --- a/v3/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go +++ b/v3/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go @@ -21,13 +21,59 @@ var listResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } ] @@ -36,19 +82,53 @@ var listResponse = fmt.Sprintf(` func listResult() []certificates.Certificate { var certificate1 certificates.Certificate + var sslKey1Info map[string]interface{} + sslKey1InfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKey1InfoJson), &sslKey1Info) + if err != nil { + panic(err) + } + sslKey1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKey1Info, + } + + var sslCert1Info map[string]interface{} + sslCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCert1InfoJson), &sslCert1Info) + if err != nil { + panic(err) } + sslCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCert1Info, } + + var caCert1Info map[string]interface{} + caCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCert1InfoJson), &caCert1Info) + if err != nil { + panic(err) + } + caCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCert1Info, } var tags1 map[string]interface{} tags1Json := `{"key":"value"}` - err := json.Unmarshal([]byte(tags1Json), &tags1) + err = json.Unmarshal([]byte(tags1Json), &tags1) if err != nil { panic(err) } @@ -87,13 +167,16 @@ var createResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} } } }`) @@ -101,19 +184,45 @@ var createResponse = fmt.Sprintf(` func createResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -141,13 +250,59 @@ var showResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -155,19 +310,53 @@ var showResponse = fmt.Sprintf(` func showResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) + } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -206,13 +395,59 @@ var updateResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -220,19 +455,53 @@ var updateResponse = fmt.Sprintf(` func updateResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, + } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -251,6 +520,7 @@ func updateResult() *certificates.Certificate { var uploadFileRequest = fmt.Sprintf(` { - "type": "ca-cert", - "content": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRgpHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3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tLS0tCg==", + "passphrase": "passphrase" }`) diff --git a/v3/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go b/v3/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go index 9f474bcd..c77adc2c 100644 --- a/v3/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go +++ b/v3/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go @@ -205,8 +205,9 @@ func TestUploadFileCertificate(t *testing.T) { cli := ServiceClient() uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", - Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRgpHSElKS0xNTk9QUVJTVFVWV1hZWm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xMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + Passphrase: "passphrase", } err := certificates.UploadFile(cli, id, uploadFileOpts).ExtractErr() diff --git a/v3/ecl/managed_load_balancer/v1/health_monitors/requests.go b/v3/ecl/managed_load_balancer/v1/health_monitors/requests.go index f8aa36b8..9433f98d 100644 --- a/v3/ecl/managed_load_balancer/v1/health_monitors/requests.go +++ b/v3/ecl/managed_load_balancer/v1/health_monitors/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -99,17 +99,18 @@ Create Health Monitor type CreateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Port number of the health monitor for healthchecking @@ -220,17 +221,18 @@ Update Health Monitor Attributes type UpdateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } diff --git a/v3/ecl/managed_load_balancer/v1/health_monitors/results.go b/v3/ecl/managed_load_balancer/v1/health_monitors/results.go index 782e07af..5ea28ee5 100644 --- a/v3/ecl/managed_load_balancer/v1/health_monitors/results.go +++ b/v3/ecl/managed_load_balancer/v1/health_monitors/results.go @@ -112,6 +112,8 @@ type HealthMonitor struct { // - Changed configurations of the health monitor exists that waiting to be applied // - `"DELETE_STAGED"` // - The health monitor has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the health monitor belongs to @@ -132,6 +134,8 @@ type HealthMonitor struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the health monitor belongs to diff --git a/v3/ecl/managed_load_balancer/v1/listeners/requests.go b/v3/ecl/managed_load_balancer/v1/listeners/requests.go index 8b89884a..18d7bb41 100644 --- a/v3/ecl/managed_load_balancer/v1/listeners/requests.go +++ b/v3/ecl/managed_load_balancer/v1/listeners/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -85,23 +85,31 @@ Create Listener type CreateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the listener for listening @@ -188,17 +196,18 @@ Update Listener Attribute type UpdateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -249,9 +258,16 @@ Create Staged Listener Configurations type CreateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address,omitempty"` // - Port number of the listener for listening @@ -309,9 +325,16 @@ Update Staged Listener Configurations type UpdateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address,omitempty"` // - Port number of the listener for listening diff --git a/v3/ecl/managed_load_balancer/v1/listeners/results.go b/v3/ecl/managed_load_balancer/v1/listeners/results.go index f47e746e..fc133983 100644 --- a/v3/ecl/managed_load_balancer/v1/listeners/results.go +++ b/v3/ecl/managed_load_balancer/v1/listeners/results.go @@ -94,6 +94,8 @@ type Listener struct { // - Changed configurations of the listener exists that waiting to be applied // - `"DELETE_STAGED"` // - The listener has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the listener belongs to @@ -114,6 +116,8 @@ type Listener struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the listener belongs to diff --git a/v3/ecl/managed_load_balancer/v1/load_balancers/requests.go b/v3/ecl/managed_load_balancer/v1/load_balancers/requests.go index 1ec49cdc..d5508525 100644 --- a/v3/ecl/managed_load_balancer/v1/load_balancers/requests.go +++ b/v3/ecl/managed_load_balancer/v1/load_balancers/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -92,9 +92,16 @@ type CreateOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -104,18 +111,26 @@ type CreateOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy - ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateOptsSyslogServer represents syslog_server information in the load balancer creation. @@ -137,21 +152,22 @@ type CreateOptsSyslogServer struct { type CreateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the plan - PlanID string `json:"plan_id,omitempty"` + PlanID string `json:"plan_id"` // - Syslog servers to which access logs are transferred // - The facility code of syslog is 0 (kern), and the severity level is 6 (info) @@ -166,7 +182,7 @@ type CreateOpts struct { // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed - Interfaces *[]CreateOptsInterface `json:"interfaces,omitempty"` + Interfaces *[]CreateOptsInterface `json:"interfaces"` } // ToLoadBalancerCreateMap builds a request body from CreateOpts. @@ -242,17 +258,18 @@ Update Load Balancer Attributes type UpdateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -368,9 +385,16 @@ type CreateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -380,20 +404,28 @@ type CreateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateStagedOptsSyslogServer represents syslog_server information in the load balancer configurations creation. @@ -478,9 +510,16 @@ type UpdateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` } @@ -490,20 +529,28 @@ type UpdateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID *string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress *string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // UpdateStagedOptsSyslogServer represents syslog_server information in load balancer configurations updation. diff --git a/v3/ecl/managed_load_balancer/v1/load_balancers/results.go b/v3/ecl/managed_load_balancer/v1/load_balancers/results.go index c74315e2..b983c139 100644 --- a/v3/ecl/managed_load_balancer/v1/load_balancers/results.go +++ b/v3/ecl/managed_load_balancer/v1/load_balancers/results.go @@ -138,6 +138,8 @@ type LoadBalancer struct { // - The load balancer has been added and waiting to be applied // - `"UPDATE_STAGED"` // - Changed configurations of the load balancer exists that waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Monitoring status of the load balancer @@ -167,6 +169,8 @@ type LoadBalancer struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - The zone / group where the primary virtual server of load balancer is deployed diff --git a/v3/ecl/managed_load_balancer/v1/plans/requests.go b/v3/ecl/managed_load_balancer/v1/plans/requests.go index e8fc321a..a8cc31e1 100644 --- a/v3/ecl/managed_load_balancer/v1/plans/requests.go +++ b/v3/ecl/managed_load_balancer/v1/plans/requests.go @@ -48,15 +48,18 @@ type ListOpts struct { // - Maximum number of target groups for the plan MaxNumberOfTargetGroups int `q:"max_number_of_target_groups"` - // - Maximum number of members for the target group of plan + // - Maximum number of members for the target group of the plan MaxNumberOfMembers int `q:"max_number_of_members"` - // - Maximum number of rules for the policy of plan + // - Maximum number of rules for the policy of the plan MaxNumberOfRules int `q:"max_number_of_rules"` // - Maximum number of conditions in the rule of the plan MaxNumberOfConditions int `q:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) for the policy of the plan + MaxNumberOfServerNameInidications int `q:"max_number_of_server_name_inidications"` + // - Whether a new load balancer can be created with this plan Enabled bool `q:"enabled"` } diff --git a/v3/ecl/managed_load_balancer/v1/plans/results.go b/v3/ecl/managed_load_balancer/v1/plans/results.go index 244c54de..8a8e0ec0 100644 --- a/v3/ecl/managed_load_balancer/v1/plans/results.go +++ b/v3/ecl/managed_load_balancer/v1/plans/results.go @@ -27,39 +27,42 @@ type Plan struct { // - Description of the plan Description string `json:"description"` - // - Bandwidth of the load balancer created with this plan + // - Bandwidth of the load balancer Bandwidth string `json:"bandwidth"` - // - Redundancy of the load balancer created with this plan + // - Redundancy of the load balancer Redundancy string `json:"redundancy"` - // - Maximum number of interfaces for the load balancer created with this plan + // - Maximum number of interfaces for the load balancer MaxNumberOfInterfaces int `json:"max_number_of_interfaces"` - // - Maximum number of health monitors for the load balancer created with this plan + // - Maximum number of health monitors for the load balancer MaxNumberOfHealthMonitors int `json:"max_number_of_health_monitors"` - // - Maximum number of listeners for the load balancer created with this plan + // - Maximum number of listeners for the load balancer MaxNumberOfListeners int `json:"max_number_of_listeners"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of policies for the load balancer MaxNumberOfPolicies int `json:"max_number_of_policies"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of routes for the load balancer MaxNumberOfRoutes int `json:"max_number_of_routes"` - // - Maximum number of target groups for the load balancer created with this plan + // - Maximum number of target groups for the load balancer MaxNumberOfTargetGroups int `json:"max_number_of_target_groups"` - // - Maximum number of members for the target group of load balancer created with this plan + // - Maximum number of members for a target group MaxNumberOfMembers int `json:"max_number_of_members"` - // - Maximum number of rules for the policy of load balancer created with this plan + // - Maximum number of rules for a policy MaxNumberOfRules int `json:"max_number_of_rules"` - // - Maximum number of conditions in the rule of load balancer created with this plan + // - Maximum number of conditions in a rule MaxNumberOfConditions int `json:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) in a policy + MaxNumberOfServerNameIndications int `json:"max_number_of_server_name_indications"` + // - Whether a new load balancer can be created with this plan Enabled bool `json:"enabled"` } diff --git a/v3/ecl/managed_load_balancer/v1/plans/testing/fixtures.go b/v3/ecl/managed_load_balancer/v1/plans/testing/fixtures.go index 98418068..5daf8a41 100644 --- a/v3/ecl/managed_load_balancer/v1/plans/testing/fixtures.go +++ b/v3/ecl/managed_load_balancer/v1/plans/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } ] @@ -48,6 +49,7 @@ func listResult() []plans.Plan { plan1.MaxNumberOfMembers = 100 plan1.MaxNumberOfRules = 50 plan1.MaxNumberOfConditions = 5 + plan1.MaxNumberOfServerNameIndications = 50 plan1.Enabled = true return []plans.Plan{plan1} @@ -70,6 +72,7 @@ var showResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } }`) @@ -91,6 +94,7 @@ func showResult() *plans.Plan { plan.MaxNumberOfMembers = 100 plan.MaxNumberOfRules = 50 plan.MaxNumberOfConditions = 5 + plan.MaxNumberOfServerNameIndications = 50 plan.Enabled = true return &plan diff --git a/v3/ecl/managed_load_balancer/v1/policies/doc.go b/v3/ecl/managed_load_balancer/v1/policies/doc.go index a804c5df..0cc168b0 100644 --- a/v3/ecl/managed_load_balancer/v1/policies/doc.go +++ b/v3/ecl/managed_load_balancer/v1/policies/doc.go @@ -21,6 +21,12 @@ Example to list policies Example to create a policy + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -35,13 +41,16 @@ Example to create a policy Tags: tags, Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } @@ -101,16 +110,25 @@ Example to delete a policy Example to create staged policy configurations + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } @@ -134,8 +152,20 @@ Example to show staged policy configurations Example to update staged policy configurations + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -143,17 +173,21 @@ Example to update staged policy configurations healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ Algorithm: &algorithm, Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, IdleTimeout: &idleTimeout, SorryPageUrl: &sorryPageUrl, SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: &certificateID, HealthMonitorID: &healthMonitorID, ListenerID: &listenerID, DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, TLSPolicyID: &tlsPolicyID, } diff --git a/v3/ecl/managed_load_balancer/v1/policies/requests.go b/v3/ecl/managed_load_balancer/v1/policies/requests.go index a4e8fc06..59958a96 100644 --- a/v3/ecl/managed_load_balancer/v1/policies/requests.go +++ b/v3/ecl/managed_load_balancer/v1/policies/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -36,7 +36,13 @@ type ListOpts struct { // - Persistence setting of the policy Persistence string `q:"persistence"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + PersistenceTimeout int `q:"persistence_timeout"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive IdleTimeout int `q:"idle_timeout"` // - URL of the sorry page to which accesses are redirected if all members in the target group are down @@ -46,6 +52,7 @@ type ListOpts struct { SourceNat string `q:"source_nat"` // - ID of the certificate that assigned to the policy + // - Also includes certificate contained in `server_name_indications` CertificateID string `q:"certificate_id"` // - ID of the health monitor that assigned to the policy @@ -57,6 +64,10 @@ type ListOpts struct { // - ID of the default target group that assigned to the policy DefaultTargetGroupID string `q:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the TLS policy that assigned to the policy TLSPolicyID string `q:"tls_policy_id"` @@ -102,21 +113,45 @@ func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { Create Policy */ +// CreateOptsServerNameIndication represents server_name_indication information in the policy creation. +type CreateOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateOpts represents options used to create a new policy. type CreateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Load balancing algorithm (method) of the policy @@ -126,16 +161,29 @@ type CreateOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -146,10 +194,17 @@ type CreateOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -162,9 +217,24 @@ type CreateOpts struct { ListenerID string `json:"listener_id"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -248,17 +318,18 @@ Update Policy Attributes type UpdateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -305,6 +376,29 @@ func Delete(c *eclcloud.ServiceClient, id string) (r DeleteResult) { Create Staged Policy Configurations */ +// CreateStagedOptsServerNameIndication represents server_name_indication information in the policy configurations creation. +type CreateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateStagedOpts represents options used to create new policy configurations. type CreateStagedOpts struct { @@ -315,16 +409,29 @@ type CreateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -336,11 +443,18 @@ type CreateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -353,9 +467,24 @@ type CreateStagedOpts struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -407,6 +536,29 @@ func ShowStaged(c *eclcloud.ServiceClient, id string) (r ShowStagedResult) { Update Staged Policy Configurations */ +// UpdateStagedOptsServerNameIndication represents server_name_indication information in policy configurations updation. +type UpdateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName *string `json:"server_name"` + + // - You can choice the input type of the server name + InputType *string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority *int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID *string `json:"certificate_id"` +} + // UpdateStagedOpts represents options used to update existing Policy configurations. type UpdateStagedOpts struct { @@ -417,16 +569,29 @@ type UpdateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence *string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout *int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout *int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -438,11 +603,18 @@ type UpdateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat *string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]UpdateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID *string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -455,9 +627,24 @@ type UpdateStagedOpts struct { ListenerID *string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID *string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set diff --git a/v3/ecl/managed_load_balancer/v1/policies/results.go b/v3/ecl/managed_load_balancer/v1/policies/results.go index 5bf79b4c..c402f4ce 100644 --- a/v3/ecl/managed_load_balancer/v1/policies/results.go +++ b/v3/ecl/managed_load_balancer/v1/policies/results.go @@ -67,16 +67,27 @@ type ConfigurationInResponse struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -86,6 +97,11 @@ type ConfigurationInResponse struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -97,13 +113,41 @@ type ConfigurationInResponse struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` } +// ServerNameIndicationInResponse represents a server name indication in a policy. +type ServerNameIndicationInResponse struct { + + // - The server name of Server Name Indication (SNI) + ServerName string `json:"server_name"` + + // - Input type of the server name + // - Default value is `"fixed"` + InputType string `json:"input_type"` + + // - Priority of Server Name Indication (SNI) + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + CertificateID string `json:"certificate_id"` +} + // Policy represents a policy. type Policy struct { @@ -128,6 +172,8 @@ type Policy struct { // - Changed configurations of the policy exists that waiting to be applied // - `"DELETE_STAGED"` // - The policy has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the policy belongs to @@ -148,6 +194,8 @@ type Policy struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the policy belongs to @@ -163,16 +211,27 @@ type Policy struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -182,6 +241,11 @@ type Policy struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -193,8 +257,19 @@ type Policy struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` diff --git a/v3/ecl/managed_load_balancer/v1/policies/testing/fixtures.go b/v3/ecl/managed_load_balancer/v1/policies/testing/fixtures.go index fb0d5727..0cd5a8ee 100644 --- a/v3/ecl/managed_load_balancer/v1/policies/testing/fixtures.go +++ b/v3/ecl/managed_load_balancer/v1/policies/testing/fixtures.go @@ -25,13 +25,23 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } ] @@ -40,6 +50,13 @@ var listResponse = fmt.Sprintf(` func listResult() []policies.Policy { var policy1 policies.Policy + serverNameIndication11 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + var tags1 map[string]interface{} tags1Json := `{"key":"value"}` err := json.Unmarshal([]byte(tags1Json), &tags1) @@ -57,13 +74,16 @@ func listResult() []policies.Policy { policy1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy1.Algorithm = "round-robin" policy1.Persistence = "cookie" + policy1.PersistenceTimeout = 525600 policy1.IdleTimeout = 600 policy1.SorryPageUrl = "https://example.com/sorry" policy1.SourceNat = "enable" + policy1.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication11} policy1.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy1.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy1.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy1.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy1.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy1.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return []policies.Policy{policy1} @@ -79,13 +99,23 @@ var createRequest = fmt.Sprintf(` }, "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "load_balancer_id": "67fea379-cff0-4191-9175-de7d6941a040" } @@ -106,13 +136,16 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -137,13 +170,16 @@ func createResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -164,24 +200,44 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "current": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" }, "staged": null @@ -191,18 +247,27 @@ var showResponse = fmt.Sprintf(` func showResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var staged policies.ConfigurationInResponse current := policies.ConfigurationInResponse{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: []policies.ServerNameIndicationInResponse{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } var tags map[string]interface{} @@ -222,13 +287,16 @@ func showResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" policy.Current = current policy.Staged = staged @@ -262,13 +330,16 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -293,13 +364,16 @@ func updateResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -310,13 +384,23 @@ var createStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -326,13 +410,23 @@ var createStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -340,15 +434,25 @@ var createStagedResponse = fmt.Sprintf(` func createStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -359,13 +463,23 @@ var showStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -373,15 +487,25 @@ var showStagedResponse = fmt.Sprintf(` func showStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -392,13 +516,23 @@ var updateStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -408,13 +542,23 @@ var updateStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -422,15 +566,25 @@ var updateStagedResponse = fmt.Sprintf(` func updateStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy diff --git a/v3/ecl/managed_load_balancer/v1/policies/testing/requests_test.go b/v3/ecl/managed_load_balancer/v1/policies/testing/requests_test.go index e522319a..1bd55c98 100644 --- a/v3/ecl/managed_load_balancer/v1/policies/testing/requests_test.go +++ b/v3/ecl/managed_load_balancer/v1/policies/testing/requests_test.go @@ -81,6 +81,12 @@ func TestCreatePolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -89,20 +95,23 @@ func TestCreatePolicy(t *testing.T) { th.AssertNoErr(t, err) createOpts := policies.CreateOpts{ - Name: "policy", - Description: "description", - Tags: tags, - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", - LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", + Name: "policy", + Description: "description", + Tags: tags, + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } actual, err := policies.Create(cli, createOpts).Extract() @@ -218,17 +227,26 @@ func TestCreateStagedPolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } actual, err := policies.CreateStaged(cli, id, createStagedOpts).Extract() @@ -281,8 +299,20 @@ func TestUpdateStagedPolicy(t *testing.T) { cli := ServiceClient() + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -290,18 +320,22 @@ func TestUpdateStagedPolicy(t *testing.T) { healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ - Algorithm: &algorithm, - Persistence: &persistence, - IdleTimeout: &idleTimeout, - SorryPageUrl: &sorryPageUrl, - SourceNat: &sourceNat, - CertificateID: &certificateID, - HealthMonitorID: &healthMonitorID, - ListenerID: &listenerID, - DefaultTargetGroupID: &defaultTargetGroupID, - TLSPolicyID: &tlsPolicyID, + Algorithm: &algorithm, + Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, + IdleTimeout: &idleTimeout, + SorryPageUrl: &sorryPageUrl, + SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: &certificateID, + HealthMonitorID: &healthMonitorID, + ListenerID: &listenerID, + DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + TLSPolicyID: &tlsPolicyID, } actual, err := policies.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v3/ecl/managed_load_balancer/v1/routes/requests.go b/v3/ecl/managed_load_balancer/v1/routes/requests.go index 23f10639..ee09a405 100644 --- a/v3/ecl/managed_load_balancer/v1/routes/requests.go +++ b/v3/ecl/managed_load_balancer/v1/routes/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -82,17 +82,18 @@ Create Route type CreateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - CIDR of destination for the (static) route @@ -101,12 +102,19 @@ type CreateOpts struct { // - If you want to change `destination_cidr`, recreate the (static) route again // - Set a unique CIDR for all (static) routes which belong to the same load balancer // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a link-local CIDR (RFC 3927) which includes Common Function Gateway + // - Cannot use a CIDR in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) DestinationCidr string `json:"destination_cidr"` - // - ID of the load balancer which the (static) route belongs to - // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - IP address of next hop for the (static) route + // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address"` // - ID of the load balancer which the (static) route belongs to @@ -186,17 +194,18 @@ Update Route Attributes type UpdateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -246,9 +255,9 @@ Create Staged Route Configurations // CreateStagedOpts represents options used to create new route configurations. type CreateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address,omitempty"` } @@ -298,9 +307,9 @@ Update Staged Route Configurations // UpdateStagedOpts represents options used to update existing Route configurations. type UpdateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress *string `json:"next_hop_ip_address,omitempty"` } diff --git a/v3/ecl/managed_load_balancer/v1/routes/results.go b/v3/ecl/managed_load_balancer/v1/routes/results.go index db7906c6..b585daaf 100644 --- a/v3/ecl/managed_load_balancer/v1/routes/results.go +++ b/v3/ecl/managed_load_balancer/v1/routes/results.go @@ -88,6 +88,8 @@ type Route struct { // - Changed configurations of the (static) route exists that waiting to be applied // - `"DELETE_STAGED"` // - The (static) route has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the (static) route belongs to @@ -108,6 +110,8 @@ type Route struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - CIDR of destination for the (static) route diff --git a/v3/ecl/managed_load_balancer/v1/rules/doc.go b/v3/ecl/managed_load_balancer/v1/rules/doc.go index 1356c598..68ba767c 100644 --- a/v3/ecl/managed_load_balancer/v1/rules/doc.go +++ b/v3/ecl/managed_load_balancer/v1/rules/doc.go @@ -38,6 +38,7 @@ Example to create a rule Tags: tags, Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", Conditions: &condition, } @@ -103,6 +104,7 @@ Example to create staged rule configurations createStagedOpts := rules.CreateStagedOpts{ Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", Conditions: &condition, } @@ -132,9 +134,11 @@ Example to update staged rule configurations priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ Priority: &priority, TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, Conditions: &condition, } diff --git a/v3/ecl/managed_load_balancer/v1/rules/requests.go b/v3/ecl/managed_load_balancer/v1/rules/requests.go index 786fc01a..4ea3834f 100644 --- a/v3/ecl/managed_load_balancer/v1/rules/requests.go +++ b/v3/ecl/managed_load_balancer/v1/rules/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -34,8 +34,14 @@ type ListOpts struct { Priority int `q:"priority"` // - ID of the target group that assigned to the rule + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy TargetGroupID string `q:"target_group_id"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group are down, traffic is routed to the backup target group + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the policy which the rule belongs to PolicyID string `q:"policy_id"` @@ -95,34 +101,47 @@ type CreateOptsCondition struct { type CreateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy - TargetGroupID string `json:"target_group_id,omitempty"` + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + TargetGroupID string `json:"target_group_id"` + + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` // - ID of the policy which the rule belongs to // - Set ID of the policy which has a listener in which protocol is either `"http"` or `"https"` - PolicyID string `json:"policy_id,omitempty"` + PolicyID string `json:"policy_id"` // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition - Conditions *CreateOptsCondition `json:"conditions,omitempty"` + Conditions *CreateOptsCondition `json:"conditions"` } // ToRuleCreateMap builds a request body from CreateOpts. @@ -198,17 +217,18 @@ Update Rule Attributes type UpdateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -269,13 +289,25 @@ type CreateStagedOptsCondition struct { type CreateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *CreateStagedOptsCondition `json:"conditions,omitempty"` @@ -338,13 +370,25 @@ type UpdateStagedOptsCondition struct { type UpdateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority *int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID *string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *UpdateStagedOptsCondition `json:"conditions,omitempty"` diff --git a/v3/ecl/managed_load_balancer/v1/rules/results.go b/v3/ecl/managed_load_balancer/v1/rules/results.go index d4683053..526a1c0e 100644 --- a/v3/ecl/managed_load_balancer/v1/rules/results.go +++ b/v3/ecl/managed_load_balancer/v1/rules/results.go @@ -64,8 +64,16 @@ type ConfigurationInResponse struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` } @@ -101,6 +109,8 @@ type Rule struct { // - Changed configurations of the rule exists that waiting to be applied // - `"DELETE_STAGED"` // - The rule has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the rule belongs to @@ -121,6 +131,8 @@ type Rule struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the policy which the rule belongs to @@ -136,8 +148,16 @@ type Rule struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` diff --git a/v3/ecl/managed_load_balancer/v1/rules/testing/fixtures.go b/v3/ecl/managed_load_balancer/v1/rules/testing/fixtures.go index 13d34b0e..300beac1 100644 --- a/v3/ecl/managed_load_balancer/v1/rules/testing/fixtures.go +++ b/v3/ecl/managed_load_balancer/v1/rules/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -60,6 +61,7 @@ func listResult() []rules.Rule { rule1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule1.Priority = 1 rule1.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule1.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule1.Conditions = condition1 return []rules.Rule{rule1} @@ -76,6 +78,7 @@ var createRequest = fmt.Sprintf(` "policy_id": "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -100,6 +103,7 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -127,6 +131,7 @@ func createResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -148,6 +153,7 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -156,6 +162,7 @@ var showResponse = fmt.Sprintf(` "current": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -174,9 +181,10 @@ func showResult() *rules.Rule { } var staged rules.ConfigurationInResponse current := rules.ConfigurationInResponse{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: condition, } var tags map[string]interface{} @@ -197,6 +205,7 @@ func showResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition rule.Current = current rule.Staged = staged @@ -231,6 +240,7 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -258,6 +268,7 @@ func updateResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -268,6 +279,7 @@ var createStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -281,6 +293,7 @@ var createStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -298,6 +311,7 @@ func createStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -308,6 +322,7 @@ var showStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -325,6 +340,7 @@ func showStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -335,6 +351,7 @@ var updateStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -348,6 +365,7 @@ var updateStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -365,6 +383,7 @@ func updateStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule diff --git a/v3/ecl/managed_load_balancer/v1/rules/testing/requests_test.go b/v3/ecl/managed_load_balancer/v1/rules/testing/requests_test.go index b5641bdf..81282fac 100644 --- a/v3/ecl/managed_load_balancer/v1/rules/testing/requests_test.go +++ b/v3/ecl/managed_load_balancer/v1/rules/testing/requests_test.go @@ -92,13 +92,14 @@ func TestCreateRule(t *testing.T) { th.AssertNoErr(t, err) createOpts := rules.CreateOpts{ - Name: "rule", - Description: "description", - Tags: tags, - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", - Conditions: &condition, + Name: "rule", + Description: "description", + Tags: tags, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", + Conditions: &condition, } actual, err := rules.Create(cli, createOpts).Extract() @@ -218,9 +219,10 @@ func TestCreateStagedRule(t *testing.T) { PathPatterns: []string{"^/statics/"}, } createStagedOpts := rules.CreateStagedOpts{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: &condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: &condition, } actual, err := rules.CreateStaged(cli, id, createStagedOpts).Extract() @@ -279,10 +281,12 @@ func TestUpdateStagedRule(t *testing.T) { priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ - Priority: &priority, - TargetGroupID: &targetGroupID, - Conditions: &condition, + Priority: &priority, + TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + Conditions: &condition, } actual, err := rules.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v3/ecl/managed_load_balancer/v1/target_groups/requests.go b/v3/ecl/managed_load_balancer/v1/target_groups/requests.go index 5c7251e6..7705f7cb 100644 --- a/v3/ecl/managed_load_balancer/v1/target_groups/requests.go +++ b/v3/ecl/managed_load_balancer/v1/target_groups/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -76,14 +76,21 @@ Create Target Group type CreateOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -96,24 +103,25 @@ type CreateOptsMember struct { type CreateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the load balancer which the target group belongs to - LoadBalancerID string `json:"load_balancer_id,omitempty"` + LoadBalancerID string `json:"load_balancer_id"` // - Members (real servers) of the target group - Members *[]CreateOptsMember `json:"members,omitempty"` + Members *[]CreateOptsMember `json:"members"` } // ToTargetGroupCreateMap builds a request body from CreateOpts. @@ -189,17 +197,18 @@ Update Target Group Attributes type UpdateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -250,14 +259,21 @@ Create Staged Target Group Configurations type CreateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -320,14 +336,21 @@ Update Staged Target Group Configurations type UpdateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port *int `json:"port"` // - Weight for the member (real server) diff --git a/v3/ecl/managed_load_balancer/v1/target_groups/results.go b/v3/ecl/managed_load_balancer/v1/target_groups/results.go index 083ba5e9..f370fe3e 100644 --- a/v3/ecl/managed_load_balancer/v1/target_groups/results.go +++ b/v3/ecl/managed_load_balancer/v1/target_groups/results.go @@ -102,6 +102,8 @@ type TargetGroup struct { // - Changed configurations of the target group exists that waiting to be applied // - `"DELETE_STAGED"` // - The target group has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the target group belongs to @@ -122,6 +124,8 @@ type TargetGroup struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the target group belongs to diff --git a/v4/ecl/managed_load_balancer/v1/certificates/doc.go b/v4/ecl/managed_load_balancer/v1/certificates/doc.go index 02633bcd..52cb294d 100644 --- a/v4/ecl/managed_load_balancer/v1/certificates/doc.go +++ b/v4/ecl/managed_load_balancer/v1/certificates/doc.go @@ -89,8 +89,9 @@ Example to delete a certificate Example to upload a certificate file uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", + Type: "ssl-key", Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoa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XZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUClVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVYKV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWApZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaCmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWIKY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZAplZmdoaWprbG1ub3BxcnN0dXZ3eHl6VjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlCmZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + Passphrase: "passphrase", } id := "497f6eca-6276-4993-bfeb-53cbbbba6f08" diff --git a/v4/ecl/managed_load_balancer/v1/certificates/requests.go b/v4/ecl/managed_load_balancer/v1/certificates/requests.go index 67605cff..77e4fcea 100644 --- a/v4/ecl/managed_load_balancer/v1/certificates/requests.go +++ b/v4/ecl/managed_load_balancer/v1/certificates/requests.go @@ -17,16 +17,19 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - ID of the owner tenant of the resource TenantID string `q:"tenant_id"` + // - If `true` is set, information of the certificate file are displayed + Details bool `q:"details"` + // - CA certificate file upload status of the certificate CACertStatus string `q:"ca_cert_status"` @@ -76,17 +79,18 @@ Create Certificate type CreateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` } @@ -137,17 +141,18 @@ Update Certificate type UpdateOpts struct { // - Name of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the certificate - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the certificate - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -202,11 +207,19 @@ type UploadFileOpts struct { Type string `json:"type"` // - Content of the certificate file to be uploaded - // - Content must be Base64 encoded + // - The content must be Base64 encoded // - The file size before encoding must be less than or equal to 16KB // - The file format before encoding must be PEM - // - DER can be converted to PEM by using OpenSSL command + // - DER can be converted to PEM by using OpenSSL command + // - The following key algorithms are supported + // - RSA 1024, 2048, 3072 and 4096 bits + // - ECDSA P-256 (prime256v1, secp256r1), P-384 (secp384r1) and P-521 (secp521r1) + // - The content of `"ssl-cert"` and the content of `"ssl-key"` must be a pair (must be matched correctly) Content string `json:"content"` + + // - Passphrase of the certificate file to be uploaded + // - This parameter can be set when 'type' is `"ssl-key"` + Passphrase string `json:"passphrase,omitempty"` } // ToCertificateUploadFileMap builds a request body from UploadFileOpts. diff --git a/v4/ecl/managed_load_balancer/v1/certificates/results.go b/v4/ecl/managed_load_balancer/v1/certificates/results.go index b3a3c1f5..9f569ce1 100644 --- a/v4/ecl/managed_load_balancer/v1/certificates/results.go +++ b/v4/ecl/managed_load_balancer/v1/certificates/results.go @@ -44,6 +44,29 @@ type FileInResponse struct { // - File upload status of the certificate Status string `json:"status"` + + // - Information of the certificate file (JSON object format) + // - When List Certificates + // - If `details` is `true`, return object + // - When Create, Show, and Update Certificate + // - Always return object + // - For example, the following fields would be included + // - When ca_cert or ssl_cert + // - `"issuer"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"subject"` (C, ST, L, O, OU and CN) + // - Fields included in the certificate file would be shown + // - `"not_before"` and `"not_after"` + // - Format: `"%Y-%m-%d %H:%M:%S"` (UTC) + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"serial"` + // - `"fingerprint"` (SHA-256) + // - When ssl_key + // - `"key_algorithm"` + // - `"RSA-4096"` , `"EC-secp384r1"` , and so on + // - `"passphrase"` ( `true` or `false` ) + Info map[string]interface{} `json:"info"` } // Certificate represents a certificate. diff --git a/v4/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go b/v4/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go index 952c5828..c41e8d1d 100644 --- a/v4/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go +++ b/v4/ecl/managed_load_balancer/v1/certificates/testing/fixtures.go @@ -21,13 +21,59 @@ var listResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } ] @@ -36,19 +82,53 @@ var listResponse = fmt.Sprintf(` func listResult() []certificates.Certificate { var certificate1 certificates.Certificate + var sslKey1Info map[string]interface{} + sslKey1InfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKey1InfoJson), &sslKey1Info) + if err != nil { + panic(err) + } + sslKey1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKey1Info, + } + + var sslCert1Info map[string]interface{} + sslCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCert1InfoJson), &sslCert1Info) + if err != nil { + panic(err) } + sslCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCert1Info, } + + var caCert1Info map[string]interface{} + caCert1InfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCert1InfoJson), &caCert1Info) + if err != nil { + panic(err) + } + caCert1 := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCert1Info, } var tags1 map[string]interface{} tags1Json := `{"key":"value"}` - err := json.Unmarshal([]byte(tags1Json), &tags1) + err = json.Unmarshal([]byte(tags1Json), &tags1) if err != nil { panic(err) } @@ -87,13 +167,16 @@ var createResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "NOT_UPLOADED", + "info": {} } } }`) @@ -101,19 +184,45 @@ var createResponse = fmt.Sprintf(` func createResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ Status: "NOT_UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -141,13 +250,59 @@ var showResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -155,19 +310,53 @@ var showResponse = fmt.Sprintf(` func showResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) + } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) + } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -206,13 +395,59 @@ var updateResponse = fmt.Sprintf(` }, "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "ca_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "e7:61:4a:49:85:aa:7c:f2", + "fingerprint": "db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:12:2c:37:4d:bb:7a:bd" + } }, "ssl_cert": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "issuer": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "subject": { + "C": "JP", + "ST": "Tokyo", + "L": "Chiyoda-ku", + "O": "NTT Communications Corporation", + "CN": "example.com" + }, + "not_before": "2023-11-09 06:20:55", + "not_after": "2024-12-10 06:20:54", + "key_algorithm": "RSA-4096", + "serial": "d3:11:fe:4d:a3:71:4e:13", + "fingerprint": "46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:88:9f:3d:a7:c5:42:b2" + } }, "ssl_key": { - "status": "NOT_UPLOADED" + "status": "UPLOADED", + "info": { + "key_algorithm": "RSA-4096", + "passphrase": true + } } } }`) @@ -220,19 +455,53 @@ var updateResponse = fmt.Sprintf(` func updateResult() *certificates.Certificate { var certificate certificates.Certificate + var sslKeyInfo map[string]interface{} + sslKeyInfoJson := `{"key_algorithm":"RSA-4096","passphrase":true}` + err := json.Unmarshal([]byte(sslKeyInfoJson), &sslKeyInfo) + if err != nil { + panic(err) + } + sslKey := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslKeyInfo, + } + + var sslCertInfo map[string]interface{} + sslCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"d3:11:fe:4d:a3:71:4e:13","fingerprint":"46:06:c5:ed:f0:e6:9f:c5:e3:bd:06:63:54:8` + + `8:9f:3d:a7:c5:42:b2"}` + err = json.Unmarshal([]byte(sslCertInfoJson), &sslCertInfo) + if err != nil { + panic(err) } + sslCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: sslCertInfo, + } + + var caCertInfo map[string]interface{} + caCertInfoJson := `{"issuer":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"example` + + `.com"},"subject":{"C":"JP","ST":"Tokyo","L":"Chiyoda-ku","O":"NTT Communications Corporation","CN":"` + + `example.com"},"not_before":"2023-11-09 06:20:55","not_after":"2024-12-10 06:20:54","key_algorithm":"` + + `RSA-4096","serial":"e7:61:4a:49:85:aa:7c:f2","fingerprint":"db:b1:49:84:f6:2e:ec:c9:41:fc:a1:30:26:1` + + `2:2c:37:4d:bb:7a:bd"}` + err = json.Unmarshal([]byte(caCertInfoJson), &caCertInfo) + if err != nil { + panic(err) } + caCert := certificates.FileInResponse{ - Status: "NOT_UPLOADED", + Status: "UPLOADED", + Info: caCertInfo, } var tags map[string]interface{} tagsJson := `{"key":"value"}` - err := json.Unmarshal([]byte(tagsJson), &tags) + err = json.Unmarshal([]byte(tagsJson), &tags) if err != nil { panic(err) } @@ -251,6 +520,7 @@ func updateResult() *certificates.Certificate { var uploadFileRequest = fmt.Sprintf(` { - "type": "ca-cert", - "content": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0RFRgpHSElKS0xNTk9QUVJTV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V2d3h5ejAxMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + "passphrase": "passphrase" }`) diff --git a/v4/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go b/v4/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go index f1c6716b..3bf04610 100644 --- a/v4/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go +++ b/v4/ecl/managed_load_balancer/v1/certificates/testing/requests_test.go @@ -205,8 +205,9 @@ func TestUploadFileCertificate(t *testing.T) { cli := ServiceClient() uploadFileOpts := certificates.UploadFileOpts{ - Type: "ca-cert", - Content: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCjAxMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEKMjM0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMwo0NTY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1CjY3ODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1NjcKODlBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OQpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCCkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OUFCQ0QKRUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4O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FiY2RlCmZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==", + Passphrase: "passphrase", } err := certificates.UploadFile(cli, id, uploadFileOpts).ExtractErr() diff --git a/v4/ecl/managed_load_balancer/v1/health_monitors/requests.go b/v4/ecl/managed_load_balancer/v1/health_monitors/requests.go index a9706729..f3c3cb28 100644 --- a/v4/ecl/managed_load_balancer/v1/health_monitors/requests.go +++ b/v4/ecl/managed_load_balancer/v1/health_monitors/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -99,17 +99,18 @@ Create Health Monitor type CreateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Port number of the health monitor for healthchecking @@ -220,17 +221,18 @@ Update Health Monitor Attributes type UpdateOpts struct { // - Name of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the health monitor - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the health monitor - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } diff --git a/v4/ecl/managed_load_balancer/v1/health_monitors/results.go b/v4/ecl/managed_load_balancer/v1/health_monitors/results.go index 24cccd20..dc595b55 100644 --- a/v4/ecl/managed_load_balancer/v1/health_monitors/results.go +++ b/v4/ecl/managed_load_balancer/v1/health_monitors/results.go @@ -112,6 +112,8 @@ type HealthMonitor struct { // - Changed configurations of the health monitor exists that waiting to be applied // - `"DELETE_STAGED"` // - The health monitor has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the health monitor belongs to @@ -132,6 +134,8 @@ type HealthMonitor struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the health monitor belongs to diff --git a/v4/ecl/managed_load_balancer/v1/listeners/requests.go b/v4/ecl/managed_load_balancer/v1/listeners/requests.go index 3bd5c449..3a2ea763 100644 --- a/v4/ecl/managed_load_balancer/v1/listeners/requests.go +++ b/v4/ecl/managed_load_balancer/v1/listeners/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -85,23 +85,31 @@ Create Listener type CreateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the listener for listening @@ -188,17 +196,18 @@ Update Listener Attribute type UpdateOpts struct { // - Name of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the listener - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the listener - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -249,9 +258,16 @@ Create Staged Listener Configurations type CreateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address,omitempty"` // - Port number of the listener for listening @@ -309,9 +325,16 @@ Update Staged Listener Configurations type UpdateStagedOpts struct { // - IP address of the listener for listening - // - Set an unique combination of IP address and port in all listeners which belong to the same load balancer + // - Set a unique combination of IP address and port in all listeners which belong to the same load balancer // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the listener belongs to - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address,omitempty"` // - Port number of the listener for listening diff --git a/v4/ecl/managed_load_balancer/v1/listeners/results.go b/v4/ecl/managed_load_balancer/v1/listeners/results.go index 364971e0..7e9512ae 100644 --- a/v4/ecl/managed_load_balancer/v1/listeners/results.go +++ b/v4/ecl/managed_load_balancer/v1/listeners/results.go @@ -94,6 +94,8 @@ type Listener struct { // - Changed configurations of the listener exists that waiting to be applied // - `"DELETE_STAGED"` // - The listener has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the listener belongs to @@ -114,6 +116,8 @@ type Listener struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the listener belongs to diff --git a/v4/ecl/managed_load_balancer/v1/load_balancers/requests.go b/v4/ecl/managed_load_balancer/v1/load_balancers/requests.go index 1ba6593a..961e2a8c 100644 --- a/v4/ecl/managed_load_balancer/v1/load_balancers/requests.go +++ b/v4/ecl/managed_load_balancer/v1/load_balancers/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -92,9 +92,16 @@ type CreateOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -104,18 +111,26 @@ type CreateOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy - ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateOptsSyslogServer represents syslog_server information in the load balancer creation. @@ -137,21 +152,22 @@ type CreateOptsSyslogServer struct { type CreateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the plan - PlanID string `json:"plan_id,omitempty"` + PlanID string `json:"plan_id"` // - Syslog servers to which access logs are transferred // - The facility code of syslog is 0 (kern), and the severity level is 6 (info) @@ -166,7 +182,7 @@ type CreateOpts struct { // - Interfaces that attached to the load balancer // - `virtual_ip_address` and `reserved_fixed_ips` can not be changed once attached // - To change `virtual_ip_address` and `reserved_fixed_ips` , recreating the interface is needed - Interfaces *[]CreateOptsInterface `json:"interfaces,omitempty"` + Interfaces *[]CreateOptsInterface `json:"interfaces"` } // ToLoadBalancerCreateMap builds a request body from CreateOpts. @@ -242,17 +258,18 @@ Update Load Balancer Attributes type UpdateOpts struct { // - Name of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the load balancer - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the load balancer - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -368,9 +385,16 @@ type CreateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` } @@ -380,20 +404,28 @@ type CreateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]CreateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // CreateStagedOptsSyslogServer represents syslog_server information in the load balancer configurations creation. @@ -478,9 +510,16 @@ type UpdateStagedOptsReservedFixedIP struct { // - The IP address assign to this interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` } @@ -490,20 +529,28 @@ type UpdateStagedOptsInterface struct { // - ID of the network that this interface belongs to // - Set a unique network ID in `interfaces` // - Set a network of which plane is data - // - Must not set ID of a network that uses ISP shared address (RFC 6598) + // - Must not set the ID of a network that attaches to the Common Function Gateway NetworkID *string `json:"network_id"` // - Virtual IP address of the interface within subnet // - Do not use this IP address at the interface of other devices, allowed address pairs, etc - // - Set an unique IP address in `virtual_ip_address` and `reserved_fixed_ips` - // - Must not set a network IP address and broadcast IP address + // - Set a unique IP address in `virtual_ip_address` and `reserved_fixed_ips` + // - Must not set a network address and a broadcast address // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `virtual_ip_address` value - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) VirtualIPAddress *string `json:"virtual_ip_address"` // - IP addresses that are pre-reserved for applying configurations of load balancer to be performed without losing redundancy // - If there are no changes to the `network_id` within the `interfaces[]` , set the current `reserved_fixed_ips` value - ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips"` + // - If not specified, it will be automatically assigned from unused IP addresses in the network + ReservedFixedIPs *[]UpdateStagedOptsReservedFixedIP `json:"reserved_fixed_ips,omitempty"` } // UpdateStagedOptsSyslogServer represents syslog_server information in load balancer configurations updation. diff --git a/v4/ecl/managed_load_balancer/v1/load_balancers/results.go b/v4/ecl/managed_load_balancer/v1/load_balancers/results.go index a51a9e52..359eac8b 100644 --- a/v4/ecl/managed_load_balancer/v1/load_balancers/results.go +++ b/v4/ecl/managed_load_balancer/v1/load_balancers/results.go @@ -138,6 +138,8 @@ type LoadBalancer struct { // - The load balancer has been added and waiting to be applied // - `"UPDATE_STAGED"` // - Changed configurations of the load balancer exists that waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Monitoring status of the load balancer @@ -167,6 +169,8 @@ type LoadBalancer struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - The zone / group where the primary virtual server of load balancer is deployed diff --git a/v4/ecl/managed_load_balancer/v1/plans/requests.go b/v4/ecl/managed_load_balancer/v1/plans/requests.go index 91912d75..e853d8a7 100644 --- a/v4/ecl/managed_load_balancer/v1/plans/requests.go +++ b/v4/ecl/managed_load_balancer/v1/plans/requests.go @@ -48,15 +48,18 @@ type ListOpts struct { // - Maximum number of target groups for the plan MaxNumberOfTargetGroups int `q:"max_number_of_target_groups"` - // - Maximum number of members for the target group of plan + // - Maximum number of members for the target group of the plan MaxNumberOfMembers int `q:"max_number_of_members"` - // - Maximum number of rules for the policy of plan + // - Maximum number of rules for the policy of the plan MaxNumberOfRules int `q:"max_number_of_rules"` // - Maximum number of conditions in the rule of the plan MaxNumberOfConditions int `q:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) for the policy of the plan + MaxNumberOfServerNameInidications int `q:"max_number_of_server_name_inidications"` + // - Whether a new load balancer can be created with this plan Enabled bool `q:"enabled"` } diff --git a/v4/ecl/managed_load_balancer/v1/plans/results.go b/v4/ecl/managed_load_balancer/v1/plans/results.go index 6bf13c32..e7cb09ae 100644 --- a/v4/ecl/managed_load_balancer/v1/plans/results.go +++ b/v4/ecl/managed_load_balancer/v1/plans/results.go @@ -27,39 +27,42 @@ type Plan struct { // - Description of the plan Description string `json:"description"` - // - Bandwidth of the load balancer created with this plan + // - Bandwidth of the load balancer Bandwidth string `json:"bandwidth"` - // - Redundancy of the load balancer created with this plan + // - Redundancy of the load balancer Redundancy string `json:"redundancy"` - // - Maximum number of interfaces for the load balancer created with this plan + // - Maximum number of interfaces for the load balancer MaxNumberOfInterfaces int `json:"max_number_of_interfaces"` - // - Maximum number of health monitors for the load balancer created with this plan + // - Maximum number of health monitors for the load balancer MaxNumberOfHealthMonitors int `json:"max_number_of_health_monitors"` - // - Maximum number of listeners for the load balancer created with this plan + // - Maximum number of listeners for the load balancer MaxNumberOfListeners int `json:"max_number_of_listeners"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of policies for the load balancer MaxNumberOfPolicies int `json:"max_number_of_policies"` - // - Maximum number of routes for the load balancer created with this plan + // - Maximum number of routes for the load balancer MaxNumberOfRoutes int `json:"max_number_of_routes"` - // - Maximum number of target groups for the load balancer created with this plan + // - Maximum number of target groups for the load balancer MaxNumberOfTargetGroups int `json:"max_number_of_target_groups"` - // - Maximum number of members for the target group of load balancer created with this plan + // - Maximum number of members for a target group MaxNumberOfMembers int `json:"max_number_of_members"` - // - Maximum number of rules for the policy of load balancer created with this plan + // - Maximum number of rules for a policy MaxNumberOfRules int `json:"max_number_of_rules"` - // - Maximum number of conditions in the rule of load balancer created with this plan + // - Maximum number of conditions in a rule MaxNumberOfConditions int `json:"max_number_of_conditions"` + // - Maximum number of Server Name Indications (SNIs) in a policy + MaxNumberOfServerNameIndications int `json:"max_number_of_server_name_indications"` + // - Whether a new load balancer can be created with this plan Enabled bool `json:"enabled"` } diff --git a/v4/ecl/managed_load_balancer/v1/plans/testing/fixtures.go b/v4/ecl/managed_load_balancer/v1/plans/testing/fixtures.go index 1d1cf683..4d2b5452 100644 --- a/v4/ecl/managed_load_balancer/v1/plans/testing/fixtures.go +++ b/v4/ecl/managed_load_balancer/v1/plans/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } ] @@ -48,6 +49,7 @@ func listResult() []plans.Plan { plan1.MaxNumberOfMembers = 100 plan1.MaxNumberOfRules = 50 plan1.MaxNumberOfConditions = 5 + plan1.MaxNumberOfServerNameIndications = 50 plan1.Enabled = true return []plans.Plan{plan1} @@ -70,6 +72,7 @@ var showResponse = fmt.Sprintf(` "max_number_of_members": 100, "max_number_of_rules": 50, "max_number_of_conditions": 5, + "max_number_of_server_name_indications": 50, "enabled": true } }`) @@ -91,6 +94,7 @@ func showResult() *plans.Plan { plan.MaxNumberOfMembers = 100 plan.MaxNumberOfRules = 50 plan.MaxNumberOfConditions = 5 + plan.MaxNumberOfServerNameIndications = 50 plan.Enabled = true return &plan diff --git a/v4/ecl/managed_load_balancer/v1/policies/doc.go b/v4/ecl/managed_load_balancer/v1/policies/doc.go index a804c5df..0cc168b0 100644 --- a/v4/ecl/managed_load_balancer/v1/policies/doc.go +++ b/v4/ecl/managed_load_balancer/v1/policies/doc.go @@ -21,6 +21,12 @@ Example to list policies Example to create a policy + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -35,13 +41,16 @@ Example to create a policy Tags: tags, Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } @@ -101,16 +110,25 @@ Example to delete a policy Example to create staged policy configurations + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ Algorithm: "round-robin", Persistence: "cookie", + PersistenceTimeout: 525600, IdleTimeout: 600, SorryPageUrl: "https://example.com/sorry", SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } @@ -134,8 +152,20 @@ Example to show staged policy configurations Example to update staged policy configurations + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -143,17 +173,21 @@ Example to update staged policy configurations healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ Algorithm: &algorithm, Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, IdleTimeout: &idleTimeout, SorryPageUrl: &sorryPageUrl, SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, CertificateID: &certificateID, HealthMonitorID: &healthMonitorID, ListenerID: &listenerID, DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, TLSPolicyID: &tlsPolicyID, } diff --git a/v4/ecl/managed_load_balancer/v1/policies/requests.go b/v4/ecl/managed_load_balancer/v1/policies/requests.go index 64e88e9b..2e5161be 100644 --- a/v4/ecl/managed_load_balancer/v1/policies/requests.go +++ b/v4/ecl/managed_load_balancer/v1/policies/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -36,7 +36,13 @@ type ListOpts struct { // - Persistence setting of the policy Persistence string `q:"persistence"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + PersistenceTimeout int `q:"persistence_timeout"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive IdleTimeout int `q:"idle_timeout"` // - URL of the sorry page to which accesses are redirected if all members in the target group are down @@ -46,6 +52,7 @@ type ListOpts struct { SourceNat string `q:"source_nat"` // - ID of the certificate that assigned to the policy + // - Also includes certificate contained in `server_name_indications` CertificateID string `q:"certificate_id"` // - ID of the health monitor that assigned to the policy @@ -57,6 +64,10 @@ type ListOpts struct { // - ID of the default target group that assigned to the policy DefaultTargetGroupID string `q:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the TLS policy that assigned to the policy TLSPolicyID string `q:"tls_policy_id"` @@ -102,21 +113,45 @@ func List(c *eclcloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { Create Policy */ +// CreateOptsServerNameIndication represents server_name_indication information in the policy creation. +type CreateOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateOpts represents options used to create a new policy. type CreateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Load balancing algorithm (method) of the policy @@ -126,16 +161,29 @@ type CreateOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -146,10 +194,17 @@ type CreateOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -162,9 +217,24 @@ type CreateOpts struct { ListenerID string `json:"listener_id"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -248,17 +318,18 @@ Update Policy Attributes type UpdateOpts struct { // - Name of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the policy - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the policy - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -305,6 +376,29 @@ func Delete(c *eclcloud.ServiceClient, id string) (r DeleteResult) { Create Staged Policy Configurations */ +// CreateStagedOptsServerNameIndication represents server_name_indication information in the policy configurations creation. +type CreateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName string `json:"server_name"` + + // - You can choice the input type of the server name + InputType string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID string `json:"certificate_id"` +} + // CreateStagedOpts represents options used to create new policy configurations. type CreateStagedOpts struct { @@ -315,16 +409,29 @@ type CreateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -336,11 +443,18 @@ type CreateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]CreateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -353,9 +467,24 @@ type CreateStagedOpts struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set @@ -407,6 +536,29 @@ func ShowStaged(c *eclcloud.ServiceClient, id string) (r ShowStagedResult) { Update Staged Policy Configurations */ +// UpdateStagedOptsServerNameIndication represents server_name_indication information in policy configurations updation. +type UpdateStagedOptsServerNameIndication struct { + + // - The server name of Server Name Indication (SNI) + // - Must be unique in a policy + // - If `input_type` is `"fixed"` , the following restrictions apply + // - Only `a-z A-Z 0-9 - . *` are allowed + // - `"*"` and `"."` are count as double (2 characters) + ServerName *string `json:"server_name"` + + // - You can choice the input type of the server name + InputType *string `json:"input_type,omitempty"` + + // - Priority of Server Name Indication (SNI) + // - Must be unique in a policy + Priority *int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + // - The certificate need to be in `"UPLOADED"` state before used in a policy + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` + CertificateID *string `json:"certificate_id"` +} + // UpdateStagedOpts represents options used to update existing Policy configurations. type UpdateStagedOpts struct { @@ -417,16 +569,29 @@ type UpdateStagedOpts struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence *string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Must not set this parameter or set `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - This parameter can be set between `1` to `2000` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + // - This parameter can be set between `0` to `525600` + PersistenceTimeout *int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout *int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If `listener.protocol` is `"http"` or `"https"`, this parameter can be set // - If `listener.protocol` is neither `"http"` nor `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"http"` or `"https"` to others, set `""` @@ -438,11 +603,18 @@ type UpdateStagedOpts struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat *string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If `listener.protocol` is not `"https"`, must not set this parameter or set `[]` + // - If you change `listener.protocol` from `"https"` to others, set `[]` + ServerNameIndications *[]UpdateStagedOptsServerNameIndication `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy - // - You can set a ID of the certificate in which `ca_cert.status`, `ssl_cert.status` and `ssl_key.status` are all `"UPLOADED"` + // - The certificate need to be in `"UPLOADED"` state before used in a policy // - If `listener.protocol` is `"https"`, set `certificate.id` // - If `listener.protocol` is not `"https"`, must not set this parameter or set `""` // - If you change `listener.protocol` from `"https"` to others, set `""` + // - The load balancer can be configured with up to 50 unique certificates, combining `policy.certificate_id` and `policy.server_name_indications.certificate_id` CertificateID *string `json:"certificate_id,omitempty"` // - ID of the health monitor that assigned to the policy @@ -455,9 +627,24 @@ type UpdateStagedOpts struct { ListenerID *string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond + // - The same member cannot be specified for the default target group and the backup target group // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` DefaultTargetGroupID *string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + // - Set a different ID of the target group from `default_target_group_id` + // - The same member cannot be specified for the default target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If `listener.protocol` is `"https"`, you can set this parameter explicitly // - If not set this parameter, the ID of the `tls_policy` with `default: true` will be automatically set diff --git a/v4/ecl/managed_load_balancer/v1/policies/results.go b/v4/ecl/managed_load_balancer/v1/policies/results.go index a88a0155..f1b425b9 100644 --- a/v4/ecl/managed_load_balancer/v1/policies/results.go +++ b/v4/ecl/managed_load_balancer/v1/policies/results.go @@ -67,16 +67,27 @@ type ConfigurationInResponse struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -86,6 +97,11 @@ type ConfigurationInResponse struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -97,13 +113,41 @@ type ConfigurationInResponse struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` } +// ServerNameIndicationInResponse represents a server name indication in a policy. +type ServerNameIndicationInResponse struct { + + // - The server name of Server Name Indication (SNI) + ServerName string `json:"server_name"` + + // - Input type of the server name + // - Default value is `"fixed"` + InputType string `json:"input_type"` + + // - Priority of Server Name Indication (SNI) + Priority int `json:"priority"` + + // - ID of the certificate that assigned to Server Name Indication (SNI) + CertificateID string `json:"certificate_id"` +} + // Policy represents a policy. type Policy struct { @@ -128,6 +172,8 @@ type Policy struct { // - Changed configurations of the policy exists that waiting to be applied // - `"DELETE_STAGED"` // - The policy has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the policy belongs to @@ -148,6 +194,8 @@ type Policy struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the policy belongs to @@ -163,16 +211,27 @@ type Policy struct { // - If `listener.protocol` is `"http"` or `"https"`, `"cookie"` is available Persistence string `json:"persistence,omitempty"` - // - The duration (in seconds) during which a session is allowed to remain inactive + // - If `persistence` is `"none"` + // - Returns `0` + // - If `persistence` is `"source-ip"` + // - The timeout (in minutes) during which the persistence remain after the latest traffic from the client is sent to the load balancer + // - Default value is `5` + // - If `persistence` is `"cookie"` + // - The expiration (in minutes) of the persistence set in the cookie that the load balancer returns to the client + // - If you specify `0` , the cookie persists only for the current session + // - Default value is `525600` + PersistenceTimeout int `json:"persistence_timeout,omitempty"` + + // - The timeout (in seconds) during which a session is allowed to remain inactive // - There may be a time difference up to 60 seconds, between the set value and the actual timeout // - If `listener.protocol` is `"tcp"` or `"udp"` - // - Default value is 120 + // - Default value is `120` // - If `listener.protocol` is `"http"` or `"https"` - // - Default value is 600 + // - Default value is `600` // - On session timeout, the load balancer sends TCP RST packets to both the client and the real server IdleTimeout int `json:"idle_timeout,omitempty"` - // - URL of the sorry page to which accesses are redirected if all members in the target group are down + // - URL of the sorry page to which accesses are redirected if all members in the target groups are down // - If protocol is not `"http"` or `"https"`, returns `""` SorryPageUrl string `json:"sorry_page_url,omitempty"` @@ -182,6 +241,11 @@ type Policy struct { // - `X-Forwarded-For` header with the IP address of the client is added SourceNat string `json:"source_nat,omitempty"` + // - The list of Server Name Indications (SNIs) allows the policy to presents multiple certificates on the same listener + // - The SNI with the highest priority value will be used when multiple SNIs match + // - If protocol is not `"https"`, returns `[]` + ServerNameIndications []ServerNameIndicationInResponse `json:"server_name_indications,omitempty"` + // - ID of the certificate that assigned to the policy // - If protocol is not `"https"`, returns `""` CertificateID string `json:"certificate_id,omitempty"` @@ -193,8 +257,19 @@ type Policy struct { ListenerID string `json:"listener_id,omitempty"` // - ID of the default target group that assigned to the policy + // - If all members of the default target group are down: + // - When `backup_target_group_id` is set, traffic is routed to it + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When both `backup_target_group_id` and `sorry_page_url` are not set, the load balancer does not respond DefaultTargetGroupID string `json:"default_target_group_id,omitempty"` + // - ID of the backup target group that assigned to the policy + // - If all members of the default target group are down, traffic is routed to the backup target group + // - If all members of the backup target group are down: + // - When `sorry_page_url` is set, accesses are redirected to URL of the sorry page + // - When `sorry_page_url` is not set, the load balancer does not respond + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - ID of the TLS policy that assigned to the policy // - If protocol is not `"https"`, returns `""` TLSPolicyID string `json:"tls_policy_id,omitempty"` diff --git a/v4/ecl/managed_load_balancer/v1/policies/testing/fixtures.go b/v4/ecl/managed_load_balancer/v1/policies/testing/fixtures.go index 0e0792e0..a4cfe11b 100644 --- a/v4/ecl/managed_load_balancer/v1/policies/testing/fixtures.go +++ b/v4/ecl/managed_load_balancer/v1/policies/testing/fixtures.go @@ -25,13 +25,23 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } ] @@ -40,6 +50,13 @@ var listResponse = fmt.Sprintf(` func listResult() []policies.Policy { var policy1 policies.Policy + serverNameIndication11 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + var tags1 map[string]interface{} tags1Json := `{"key":"value"}` err := json.Unmarshal([]byte(tags1Json), &tags1) @@ -57,13 +74,16 @@ func listResult() []policies.Policy { policy1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy1.Algorithm = "round-robin" policy1.Persistence = "cookie" + policy1.PersistenceTimeout = 525600 policy1.IdleTimeout = 600 policy1.SorryPageUrl = "https://example.com/sorry" policy1.SourceNat = "enable" + policy1.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication11} policy1.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy1.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy1.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy1.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy1.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy1.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return []policies.Policy{policy1} @@ -79,13 +99,23 @@ var createRequest = fmt.Sprintf(` }, "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "load_balancer_id": "67fea379-cff0-4191-9175-de7d6941a040" } @@ -106,13 +136,16 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -137,13 +170,16 @@ func createResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -164,24 +200,44 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86", "current": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" }, "staged": null @@ -191,18 +247,27 @@ var showResponse = fmt.Sprintf(` func showResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var staged policies.ConfigurationInResponse current := policies.ConfigurationInResponse{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: []policies.ServerNameIndicationInResponse{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } var tags map[string]interface{} @@ -222,13 +287,16 @@ func showResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" policy.Current = current policy.Staged = staged @@ -262,13 +330,16 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "algorithm": null, "persistence": null, + "persistence_timeout": null, "idle_timeout": null, "sorry_page_url": null, "source_nat": null, + "server_name_indications": null, "certificate_id": null, "health_monitor_id": null, "listener_id": null, "default_target_group_id": null, + "backup_target_group_id": null, "tls_policy_id": null } }`) @@ -293,13 +364,16 @@ func updateResult() *policies.Policy { policy.TenantID = "34f5c98ef430457ba81292637d0c6fd0" policy.Algorithm = "" policy.Persistence = "" + policy.PersistenceTimeout = 0 policy.IdleTimeout = 0 policy.SorryPageUrl = "" policy.SourceNat = "" + policy.ServerNameIndications = nil policy.CertificateID = "" policy.HealthMonitorID = "" policy.ListenerID = "" policy.DefaultTargetGroupID = "" + policy.BackupTargetGroupID = "" policy.TLSPolicyID = "" return &policy @@ -310,13 +384,23 @@ var createStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -326,13 +410,23 @@ var createStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -340,15 +434,25 @@ var createStagedResponse = fmt.Sprintf(` func createStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -359,13 +463,23 @@ var showStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -373,15 +487,25 @@ var showStagedResponse = fmt.Sprintf(` func showStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy @@ -392,13 +516,23 @@ var updateStagedRequest = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -408,13 +542,23 @@ var updateStagedResponse = fmt.Sprintf(` "policy": { "algorithm": "round-robin", "persistence": "cookie", + "persistence_timeout": 525600, "idle_timeout": 600, "sorry_page_url": "https://example.com/sorry", "source_nat": "enable", + "server_name_indications": [ + { + "server_name": "*.example.com", + "input_type": "fixed", + "priority": 1, + "certificate_id": "fdfed344-e8ab-4f20-bd62-a4039453a389" + } + ], "certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7", "health_monitor_id": "dd7a96d6-4e66-4666-baca-a8555f0c472c", "listener_id": "68633f4f-f52a-402f-8572-b8173418904f", "default_target_group_id": "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + "backup_target_group_id": "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", "tls_policy_id": "4ba79662-f2a1-41a4-a3d9-595799bbcd86" } }`) @@ -422,15 +566,25 @@ var updateStagedResponse = fmt.Sprintf(` func updateStagedResult() *policies.Policy { var policy policies.Policy + serverNameIndication1 := policies.ServerNameIndicationInResponse{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } + policy.Algorithm = "round-robin" policy.Persistence = "cookie" + policy.PersistenceTimeout = 525600 policy.IdleTimeout = 600 policy.SorryPageUrl = "https://example.com/sorry" policy.SourceNat = "enable" + policy.ServerNameIndications = []policies.ServerNameIndicationInResponse{serverNameIndication1} policy.CertificateID = "f57a98fe-d63e-4048-93a0-51fe163f30d7" policy.HealthMonitorID = "dd7a96d6-4e66-4666-baca-a8555f0c472c" policy.ListenerID = "68633f4f-f52a-402f-8572-b8173418904f" policy.DefaultTargetGroupID = "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + policy.BackupTargetGroupID = "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" policy.TLSPolicyID = "4ba79662-f2a1-41a4-a3d9-595799bbcd86" return &policy diff --git a/v4/ecl/managed_load_balancer/v1/policies/testing/requests_test.go b/v4/ecl/managed_load_balancer/v1/policies/testing/requests_test.go index 15b79000..18b33143 100644 --- a/v4/ecl/managed_load_balancer/v1/policies/testing/requests_test.go +++ b/v4/ecl/managed_load_balancer/v1/policies/testing/requests_test.go @@ -81,6 +81,12 @@ func TestCreatePolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } var tags map[string]interface{} tagsJson := `{"key":"value"}` @@ -89,20 +95,23 @@ func TestCreatePolicy(t *testing.T) { th.AssertNoErr(t, err) createOpts := policies.CreateOpts{ - Name: "policy", - Description: "description", - Tags: tags, - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", - LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", + Name: "policy", + Description: "description", + Tags: tags, + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + LoadBalancerID: "67fea379-cff0-4191-9175-de7d6941a040", } actual, err := policies.Create(cli, createOpts).Extract() @@ -218,17 +227,26 @@ func TestCreateStagedPolicy(t *testing.T) { }) cli := ServiceClient() + serverNameIndication1 := policies.CreateStagedOptsServerNameIndication{ + ServerName: "*.example.com", + InputType: "fixed", + Priority: 1, + CertificateID: "fdfed344-e8ab-4f20-bd62-a4039453a389", + } createStagedOpts := policies.CreateStagedOpts{ - Algorithm: "round-robin", - Persistence: "cookie", - IdleTimeout: 600, - SorryPageUrl: "https://example.com/sorry", - SourceNat: "enable", - CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", - HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", - ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", - DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", - TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", + Algorithm: "round-robin", + Persistence: "cookie", + PersistenceTimeout: 525600, + IdleTimeout: 600, + SorryPageUrl: "https://example.com/sorry", + SourceNat: "enable", + ServerNameIndications: &[]policies.CreateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: "f57a98fe-d63e-4048-93a0-51fe163f30d7", + HealthMonitorID: "dd7a96d6-4e66-4666-baca-a8555f0c472c", + ListenerID: "68633f4f-f52a-402f-8572-b8173418904f", + DefaultTargetGroupID: "a44c4072-ed90-4b50-a33a-6b38fb10c7db", + BackupTargetGroupID: "f1a117f1-f8df-ce07-6c8c-4bbf103059b6", + TLSPolicyID: "4ba79662-f2a1-41a4-a3d9-595799bbcd86", } actual, err := policies.CreateStaged(cli, id, createStagedOpts).Extract() @@ -281,8 +299,20 @@ func TestUpdateStagedPolicy(t *testing.T) { cli := ServiceClient() + serverNameIndication1ServerName := "*.example.com" + serverNameIndication1InputType := "fixed" + serverNameIndication1Priority := 1 + serverNameIndication1CertificateID := "fdfed344-e8ab-4f20-bd62-a4039453a389" + serverNameIndication1 := policies.UpdateStagedOptsServerNameIndication{ + ServerName: &serverNameIndication1ServerName, + InputType: &serverNameIndication1InputType, + Priority: &serverNameIndication1Priority, + CertificateID: &serverNameIndication1CertificateID, + } + algorithm := "round-robin" persistence := "cookie" + persistenceTimeout := 525600 idleTimeout := 600 sorryPageUrl := "https://example.com/sorry" sourceNat := "enable" @@ -290,18 +320,22 @@ func TestUpdateStagedPolicy(t *testing.T) { healthMonitorID := "dd7a96d6-4e66-4666-baca-a8555f0c472c" listenerID := "68633f4f-f52a-402f-8572-b8173418904f" defaultTargetGroupID := "a44c4072-ed90-4b50-a33a-6b38fb10c7db" + backupTargetGroupID := "f1a117f1-f8df-ce07-6c8c-4bbf103059b6" tlsPolicyID := "4ba79662-f2a1-41a4-a3d9-595799bbcd86" updateStagedOpts := policies.UpdateStagedOpts{ - Algorithm: &algorithm, - Persistence: &persistence, - IdleTimeout: &idleTimeout, - SorryPageUrl: &sorryPageUrl, - SourceNat: &sourceNat, - CertificateID: &certificateID, - HealthMonitorID: &healthMonitorID, - ListenerID: &listenerID, - DefaultTargetGroupID: &defaultTargetGroupID, - TLSPolicyID: &tlsPolicyID, + Algorithm: &algorithm, + Persistence: &persistence, + PersistenceTimeout: &persistenceTimeout, + IdleTimeout: &idleTimeout, + SorryPageUrl: &sorryPageUrl, + SourceNat: &sourceNat, + ServerNameIndications: &[]policies.UpdateStagedOptsServerNameIndication{serverNameIndication1}, + CertificateID: &certificateID, + HealthMonitorID: &healthMonitorID, + ListenerID: &listenerID, + DefaultTargetGroupID: &defaultTargetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + TLSPolicyID: &tlsPolicyID, } actual, err := policies.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v4/ecl/managed_load_balancer/v1/routes/requests.go b/v4/ecl/managed_load_balancer/v1/routes/requests.go index c92fabc6..2d2e1cd9 100644 --- a/v4/ecl/managed_load_balancer/v1/routes/requests.go +++ b/v4/ecl/managed_load_balancer/v1/routes/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -82,17 +82,18 @@ Create Route type CreateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - CIDR of destination for the (static) route @@ -101,12 +102,19 @@ type CreateOpts struct { // - If you want to change `destination_cidr`, recreate the (static) route again // - Set a unique CIDR for all (static) routes which belong to the same load balancer // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a link-local CIDR (RFC 3927) which includes Common Function Gateway + // - Cannot use a CIDR in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) DestinationCidr string `json:"destination_cidr"` - // - ID of the load balancer which the (static) route belongs to - // - Set a CIDR which is not included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - IP address of next hop for the (static) route + // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address"` // - ID of the load balancer which the (static) route belongs to @@ -186,17 +194,18 @@ Update Route Attributes type UpdateOpts struct { // - Name of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the (static) route - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the (static) route - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -246,9 +255,9 @@ Create Staged Route Configurations // CreateStagedOpts represents options used to create new route configurations. type CreateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress string `json:"next_hop_ip_address,omitempty"` } @@ -298,9 +307,9 @@ Update Staged Route Configurations // UpdateStagedOpts represents options used to update existing Route configurations. type UpdateStagedOpts struct { - // - ID of the load balancer which the (static) route belongs to + // - IP address of next hop for the (static) route // - Set a CIDR which is included in subnet of load balancer interfaces that the (static) route belongs to - // - Must not set a network IP address and broadcast IP address + // - Must not set a network address and a broadcast address NextHopIPAddress *string `json:"next_hop_ip_address,omitempty"` } diff --git a/v4/ecl/managed_load_balancer/v1/routes/results.go b/v4/ecl/managed_load_balancer/v1/routes/results.go index 5bc90d7d..a14052d3 100644 --- a/v4/ecl/managed_load_balancer/v1/routes/results.go +++ b/v4/ecl/managed_load_balancer/v1/routes/results.go @@ -88,6 +88,8 @@ type Route struct { // - Changed configurations of the (static) route exists that waiting to be applied // - `"DELETE_STAGED"` // - The (static) route has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the (static) route belongs to @@ -108,6 +110,8 @@ type Route struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - CIDR of destination for the (static) route diff --git a/v4/ecl/managed_load_balancer/v1/rules/doc.go b/v4/ecl/managed_load_balancer/v1/rules/doc.go index 1356c598..68ba767c 100644 --- a/v4/ecl/managed_load_balancer/v1/rules/doc.go +++ b/v4/ecl/managed_load_balancer/v1/rules/doc.go @@ -38,6 +38,7 @@ Example to create a rule Tags: tags, Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", Conditions: &condition, } @@ -103,6 +104,7 @@ Example to create staged rule configurations createStagedOpts := rules.CreateStagedOpts{ Priority: 1, TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", Conditions: &condition, } @@ -132,9 +134,11 @@ Example to update staged rule configurations priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ Priority: &priority, TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, Conditions: &condition, } diff --git a/v4/ecl/managed_load_balancer/v1/rules/requests.go b/v4/ecl/managed_load_balancer/v1/rules/requests.go index 783ccdc9..b8bff48c 100644 --- a/v4/ecl/managed_load_balancer/v1/rules/requests.go +++ b/v4/ecl/managed_load_balancer/v1/rules/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -34,8 +34,14 @@ type ListOpts struct { Priority int `q:"priority"` // - ID of the target group that assigned to the rule + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy TargetGroupID string `q:"target_group_id"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group are down, traffic is routed to the backup target group + // - If all members of the target groups specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `q:"backup_target_group_id"` + // - ID of the policy which the rule belongs to PolicyID string `q:"policy_id"` @@ -95,34 +101,47 @@ type CreateOptsCondition struct { type CreateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy - TargetGroupID string `json:"target_group_id,omitempty"` + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + TargetGroupID string `json:"target_group_id"` + + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` // - ID of the policy which the rule belongs to // - Set ID of the policy which has a listener in which protocol is either `"http"` or `"https"` - PolicyID string `json:"policy_id,omitempty"` + PolicyID string `json:"policy_id"` // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition - Conditions *CreateOptsCondition `json:"conditions,omitempty"` + Conditions *CreateOptsCondition `json:"conditions"` } // ToRuleCreateMap builds a request body from CreateOpts. @@ -198,17 +217,18 @@ Update Rule Attributes type UpdateOpts struct { // - Name of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the rule - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the rule - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -269,13 +289,25 @@ type CreateStagedOptsCondition struct { type CreateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *CreateStagedOptsCondition `json:"conditions,omitempty"` @@ -338,13 +370,25 @@ type UpdateStagedOptsCondition struct { type UpdateStagedOpts struct { // - Priority of the rule - // - Set an unique number in all rules which belong to the same policy + // - Set a unique number in all rules which belong to the same policy Priority *int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule - // - Set a different target group from `"default_target_group_id"` of the policy + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` TargetGroupID *string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + // - Set a different ID of the target group from `target_group_id` + // - The same member cannot be specified for the target group and the backup target group + // - Must not set ID of the target group that `configuration_status` is `"DELETE_STAGED"` + BackupTargetGroupID *string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups // - Set one or more condition Conditions *UpdateStagedOptsCondition `json:"conditions,omitempty"` diff --git a/v4/ecl/managed_load_balancer/v1/rules/results.go b/v4/ecl/managed_load_balancer/v1/rules/results.go index 9fed0809..79e91572 100644 --- a/v4/ecl/managed_load_balancer/v1/rules/results.go +++ b/v4/ecl/managed_load_balancer/v1/rules/results.go @@ -64,8 +64,16 @@ type ConfigurationInResponse struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` } @@ -101,6 +109,8 @@ type Rule struct { // - Changed configurations of the rule exists that waiting to be applied // - `"DELETE_STAGED"` // - The rule has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the rule belongs to @@ -121,6 +131,8 @@ type Rule struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the policy which the rule belongs to @@ -136,8 +148,16 @@ type Rule struct { Priority int `json:"priority,omitempty"` // - ID of the target group that assigned to the rule + // - If all members of the target group specified in the rule are down: + // - When `backup_target_group_id` of the rule is set, traffic is routed to it + // - When `backup_target_group_id` of the rule is not set, traffic is routed to the target groups specified in the policy TargetGroupID string `json:"target_group_id,omitempty"` + // - ID of the backup target group that assigned to the rule + // - If all members of the target group specified in the rule are down, traffic is routed to the backup target group specified in the rule + // - If all members of the backup target group specified in the rule are down, traffic is routed to the target groups specified in the policy + BackupTargetGroupID string `json:"backup_target_group_id,omitempty"` + // - Conditions of the rules to distribute accesses to the target groups Conditions ConditionInResponse `json:"conditions,omitempty"` diff --git a/v4/ecl/managed_load_balancer/v1/rules/testing/fixtures.go b/v4/ecl/managed_load_balancer/v1/rules/testing/fixtures.go index 89aa42d3..ea9bf023 100644 --- a/v4/ecl/managed_load_balancer/v1/rules/testing/fixtures.go +++ b/v4/ecl/managed_load_balancer/v1/rules/testing/fixtures.go @@ -26,6 +26,7 @@ var listResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -60,6 +61,7 @@ func listResult() []rules.Rule { rule1.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule1.Priority = 1 rule1.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule1.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule1.Conditions = condition1 return []rules.Rule{rule1} @@ -76,6 +78,7 @@ var createRequest = fmt.Sprintf(` "policy_id": "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -100,6 +103,7 @@ var createResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -127,6 +131,7 @@ func createResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -148,6 +153,7 @@ var showResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -156,6 +162,7 @@ var showResponse = fmt.Sprintf(` "current": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -174,9 +181,10 @@ func showResult() *rules.Rule { } var staged rules.ConfigurationInResponse current := rules.ConfigurationInResponse{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: condition, } var tags map[string]interface{} @@ -197,6 +205,7 @@ func showResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition rule.Current = current rule.Staged = staged @@ -231,6 +240,7 @@ var updateResponse = fmt.Sprintf(` "tenant_id": "34f5c98ef430457ba81292637d0c6fd0", "priority": null, "target_group_id": null, + "backup_target_group_id": null, "conditions": null } }`) @@ -258,6 +268,7 @@ func updateResult() *rules.Rule { rule.TenantID = "34f5c98ef430457ba81292637d0c6fd0" rule.Priority = 0 rule.TargetGroupID = "" + rule.BackupTargetGroupID = "" rule.Conditions = condition return &rule @@ -268,6 +279,7 @@ var createStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -281,6 +293,7 @@ var createStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -298,6 +311,7 @@ func createStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -308,6 +322,7 @@ var showStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -325,6 +340,7 @@ func showStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule @@ -335,6 +351,7 @@ var updateStagedRequest = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -348,6 +365,7 @@ var updateStagedResponse = fmt.Sprintf(` "rule": { "priority": 1, "target_group_id": "29527a3c-9e5d-48b7-868f-6442c7d21a95", + "backup_target_group_id": "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", "conditions": { "path_patterns": [ "^/statics/" @@ -365,6 +383,7 @@ func updateStagedResult() *rules.Rule { rule.Priority = 1 rule.TargetGroupID = "29527a3c-9e5d-48b7-868f-6442c7d21a95" + rule.BackupTargetGroupID = "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" rule.Conditions = condition return &rule diff --git a/v4/ecl/managed_load_balancer/v1/rules/testing/requests_test.go b/v4/ecl/managed_load_balancer/v1/rules/testing/requests_test.go index e68c03b6..25d6d8b3 100644 --- a/v4/ecl/managed_load_balancer/v1/rules/testing/requests_test.go +++ b/v4/ecl/managed_load_balancer/v1/rules/testing/requests_test.go @@ -92,13 +92,14 @@ func TestCreateRule(t *testing.T) { th.AssertNoErr(t, err) createOpts := rules.CreateOpts{ - Name: "rule", - Description: "description", - Tags: tags, - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", - Conditions: &condition, + Name: "rule", + Description: "description", + Tags: tags, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + PolicyID: "fcb520e5-858d-4f9f-bc6c-7bd225fe7cf4", + Conditions: &condition, } actual, err := rules.Create(cli, createOpts).Extract() @@ -218,9 +219,10 @@ func TestCreateStagedRule(t *testing.T) { PathPatterns: []string{"^/statics/"}, } createStagedOpts := rules.CreateStagedOpts{ - Priority: 1, - TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", - Conditions: &condition, + Priority: 1, + TargetGroupID: "29527a3c-9e5d-48b7-868f-6442c7d21a95", + BackupTargetGroupID: "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52", + Conditions: &condition, } actual, err := rules.CreateStaged(cli, id, createStagedOpts).Extract() @@ -279,10 +281,12 @@ func TestUpdateStagedRule(t *testing.T) { priority := 1 targetGroupID := "29527a3c-9e5d-48b7-868f-6442c7d21a95" + backupTargetGroupID := "dfa2dbb6-e2f8-4a9d-a8c1-e1a578ea0a52" updateStagedOpts := rules.UpdateStagedOpts{ - Priority: &priority, - TargetGroupID: &targetGroupID, - Conditions: &condition, + Priority: &priority, + TargetGroupID: &targetGroupID, + BackupTargetGroupID: &backupTargetGroupID, + Conditions: &condition, } actual, err := rules.UpdateStaged(cli, id, updateStagedOpts).Extract() diff --git a/v4/ecl/managed_load_balancer/v1/target_groups/requests.go b/v4/ecl/managed_load_balancer/v1/target_groups/requests.go index cd34a094..13354498 100644 --- a/v4/ecl/managed_load_balancer/v1/target_groups/requests.go +++ b/v4/ecl/managed_load_balancer/v1/target_groups/requests.go @@ -17,11 +17,11 @@ type ListOpts struct { ID string `q:"id"` // - Name of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `q:"name"` // - Description of the resource - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `q:"description"` // - Configuration status of the resource @@ -76,14 +76,21 @@ Create Target Group type CreateOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -96,24 +103,25 @@ type CreateOptsMember struct { type CreateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags map[string]interface{} `json:"tags,omitempty"` // - ID of the load balancer which the target group belongs to - LoadBalancerID string `json:"load_balancer_id,omitempty"` + LoadBalancerID string `json:"load_balancer_id"` // - Members (real servers) of the target group - Members *[]CreateOptsMember `json:"members,omitempty"` + Members *[]CreateOptsMember `json:"members"` } // ToTargetGroupCreateMap builds a request body from CreateOpts. @@ -189,17 +197,18 @@ Update Target Group Attributes type UpdateOpts struct { // - Name of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Name *string `json:"name,omitempty"` // - Description of the target group - // - This field accepts single-byte characters only + // - This field accepts UTF-8 characters up to 3 bytes Description *string `json:"description,omitempty"` // - Tags of the target group - // - Set JSON object up to 32,768 characters + // - Set JSON object up to 32,767 characters // - Nested structure is permitted - // - This field accepts single-byte characters only + // - The whitespace around separators ( `","` and `":"` ) are ignored + // - This field accepts UTF-8 characters up to 3 bytes Tags *map[string]interface{} `json:"tags,omitempty"` } @@ -250,14 +259,21 @@ Create Staged Target Group Configurations type CreateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port int `json:"port"` // - Weight for the member (real server) @@ -320,14 +336,21 @@ Update Staged Target Group Configurations type UpdateStagedOptsMember struct { // - IP address of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group // - Must not set a IP address which is included in `virtual_ip_address` and `reserved_fixed_ips` of load balancer interfaces that the target group belongs to // - Must not set a IP address of listeners which belong to the same load balancer as the target group - // - Must not set a link-local IP address (RFC 3927) which includes Common Function Gateway + // - Cannot use a IP address in the following networks + // - This host on this network (0.0.0.0/8) + // - Shared Address Space (100.64.0.0/10) + // - Loopback (127.0.0.0/8) + // - Link Local (169.254.0.0/16) + // - Multicast (224.0.0.0/4) + // - Reserved (240.0.0.0/4) + // - Limited Broadcast (255.255.255.255/32) IPAddress *string `json:"ip_address"` // - Port number of the member (real server) - // - Set an unique combination of IP address and port in all members which belong to the same target group + // - Set a unique combination of IP address and port in all members which belong to the same target group Port *int `json:"port"` // - Weight for the member (real server) diff --git a/v4/ecl/managed_load_balancer/v1/target_groups/results.go b/v4/ecl/managed_load_balancer/v1/target_groups/results.go index ba663e80..2b147f81 100644 --- a/v4/ecl/managed_load_balancer/v1/target_groups/results.go +++ b/v4/ecl/managed_load_balancer/v1/target_groups/results.go @@ -102,6 +102,8 @@ type TargetGroup struct { // - Changed configurations of the target group exists that waiting to be applied // - `"DELETE_STAGED"` // - The target group has been removed and waiting to be applied + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html ConfigurationStatus string `json:"configuration_status"` // - Operation status of the load balancer which the target group belongs to @@ -122,6 +124,8 @@ type TargetGroup struct { // - The latest operation of the load balancer has been failed // - The operation was roll backed normally // - The load balancer and related resources can be operated + // - For detail, refer to the API reference appendix + // - https://sdpf.ntt.com/services/docs/managed-lb/service-descriptions/api_reference_appendix.html OperationStatus string `json:"operation_status"` // - ID of the load balancer which the target group belongs to