github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/cce/v3/clusters/testing/fixtures.go (about)

     1  package testing
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk/openstack/cce/v3/clusters"
     5  )
     6  
     7  const Output = `
     8  {
     9      "kind": "Cluster",
    10      "apiVersion": "v3",
    11      "metadata": {
    12          "name": "test-cluster",
    13          "uid": "daa97872-59d7-11e8-a787-0255ac101f54"
    14      },
    15      "spec": {
    16          "type": "VirtualMachine",
    17          "flavor": "cce.s1.small",
    18          "version": "v1.7.3-r10",
    19          "hostNetwork": {
    20              "vpc": "3305eb40-2707-4940-921c-9f335f84a2ca",
    21              "subnet": "00e41db7-e56b-4946-bf91-27bb9effd664"
    22          },
    23          "containerNetwork": {
    24              "mode": "overlay_l2"
    25          },
    26          "billingMode": 0
    27      },
    28      "status": {
    29          "phase": "Available",
    30          "endpoints": [
    31                      {
    32                          "url": "https://192.168.0.68:5443",
    33                          "type": "Internal"
    34                      }
    35                  ]
    36      }
    37  }`
    38  
    39  const OutputOTC = `
    40  {
    41      "kind": "Cluster",
    42      "apiVersion": "v3",
    43      "metadata": {
    44          "name": "test-cluster",
    45          "uid": "daa97872-59d7-11e8-a787-0255ac101f54"
    46      },
    47      "spec": {
    48          "type": "VirtualMachine",
    49          "flavor": "cce.s1.small",
    50          "version": "v1.7.3-r10",
    51          "hostNetwork": {
    52              "vpc": "3305eb40-2707-4940-921c-9f335f84a2ca",
    53              "subnet": "00e41db7-e56b-4946-bf91-27bb9effd664"
    54          },
    55          "containerNetwork": {
    56              "mode": "overlay_l2"
    57          },
    58          "billingMode": 0
    59      },
    60      "status": {
    61          "phase": "Available",
    62          "endpoints": {
    63  			"internal": "https://192.168.0.68:5443",
    64              "external": "https://10.34.56.78:5443",
    65  			"external_otc": "https://4d1ecb2c-229a-11e8-9c75-0255ac100ceb.container.eu-de.otc.t-systems.com"
    66  		}
    67                  
    68      }
    69  }`
    70  
    71  var Expected = &clusters.Clusters{
    72  	Kind:       "Cluster",
    73  	ApiVersion: "v3",
    74  	Metadata: clusters.MetaData{
    75  		Name: "test-cluster",
    76  		Id:   "daa97872-59d7-11e8-a787-0255ac101f54",
    77  	},
    78  	Spec: clusters.Spec{
    79  		Type:    "VirtualMachine",
    80  		Flavor:  "cce.s1.small",
    81  		Version: "v1.7.3-r10",
    82  		HostNetwork: clusters.HostNetworkSpec{
    83  			VpcId:    "3305eb40-2707-4940-921c-9f335f84a2ca",
    84  			SubnetId: "00e41db7-e56b-4946-bf91-27bb9effd664",
    85  		},
    86  		ContainerNetwork: clusters.ContainerNetworkSpec{
    87  			Mode: "overlay_l2",
    88  		},
    89  		BillingMode: 0,
    90  	},
    91  	Status: clusters.Status{
    92  		Phase: "Available",
    93  		Endpoints: []clusters.Endpoints{
    94  			{Url: "https://192.168.0.68:5443", Type: "Internal"},
    95  		},
    96  	},
    97  }
    98  
    99  var ExpectedOTC = &clusters.Clusters{
   100  	Kind:       "Cluster",
   101  	ApiVersion: "v3",
   102  	Metadata: clusters.MetaData{
   103  		Name: "test-cluster",
   104  		Id:   "daa97872-59d7-11e8-a787-0255ac101f54",
   105  	},
   106  	Spec: clusters.Spec{
   107  		Type:    "VirtualMachine",
   108  		Flavor:  "cce.s1.small",
   109  		Version: "v1.7.3-r10",
   110  		HostNetwork: clusters.HostNetworkSpec{
   111  			VpcId:    "3305eb40-2707-4940-921c-9f335f84a2ca",
   112  			SubnetId: "00e41db7-e56b-4946-bf91-27bb9effd664",
   113  		},
   114  		ContainerNetwork: clusters.ContainerNetworkSpec{
   115  			Mode: "overlay_l2",
   116  		},
   117  		BillingMode: 0,
   118  	},
   119  	Status: clusters.Status{
   120  		Phase: "Available",
   121  		Endpoints: []clusters.Endpoints{
   122  			{Internal: "https://192.168.0.68:5443", External: "https://10.34.56.78:5443",
   123  				ExternalOTC: "https://4d1ecb2c-229a-11e8-9c75-0255ac100ceb.container.eu-de.otc.t-systems.com"},
   124  		},
   125  	},
   126  }
   127  
   128  const ListOutput = `
   129  {
   130   "items": [
   131          {
   132              "kind": "Cluster",
   133              "apiVersion": "v3",
   134              "metadata": {
   135                  "name": "test123",
   136                  "uid": "daa97872-59d7-11e8-a787-0255ac101f54"
   137              },
   138              "spec": {
   139                  "type": "VirtualMachine",
   140                  "flavor": "cce.s1.small",
   141                  "version": "v1.7.3-r10",
   142                  "hostNetwork": {
   143                      "vpc": "3305eb40-2707-4940-921c-9f335f84a2ca",
   144                      "subnet": "00e41db7-e56b-4946-bf91-27bb9effd664"
   145                  },
   146                  "containerNetwork": {
   147                      "mode": "overlay_l2"
   148                  },
   149                  "billingMode": 0
   150              },
   151              "status": {
   152                  "phase": "Available",
   153                  "endpoints": [
   154                      {
   155                          "url": "https://192.168.0.68:5443",
   156                          "type": "Internal"
   157                      }
   158                  ]
   159              }
   160          }
   161      ]
   162  }
   163  `
   164  
   165  const ListOutputOTC = `
   166  {
   167   "items": [
   168          {
   169              "kind": "Cluster",
   170              "apiVersion": "v3",
   171              "metadata": {
   172                  "name": "test123",
   173                  "uid": "daa97872-59d7-11e8-a787-0255ac101f54"
   174              },
   175              "spec": {
   176                  "type": "VirtualMachine",
   177                  "flavor": "cce.s1.small",
   178                  "version": "v1.7.3-r10",
   179                  "hostNetwork": {
   180                      "vpc": "3305eb40-2707-4940-921c-9f335f84a2ca",
   181                      "subnet": "00e41db7-e56b-4946-bf91-27bb9effd664"
   182                  },
   183                  "containerNetwork": {
   184                      "mode": "overlay_l2"
   185                  },
   186                  "billingMode": 0
   187              },
   188              "status": {
   189                  "phase": "Available",
   190                  "endpoints": {
   191  					"internal": "https://192.168.0.68:5443",
   192              		"external": "https://10.34.56.78:5443",
   193  					"external_otc": "https://4d1ecb2c-229a-11e8-9c75-0255ac100ceb.container.eu-de.otc.t-systems.com"
   194  				}
   195              }
   196          }
   197      ]
   198  }
   199  `
   200  
   201  var ListExpected = []clusters.Clusters{
   202  	{
   203  		Kind:       "Cluster",
   204  		ApiVersion: "v3",
   205  		Metadata:   clusters.MetaData{Name: "test123", Id: "daa97872-59d7-11e8-a787-0255ac101f54"},
   206  		Spec: clusters.Spec{Type: "VirtualMachine",
   207  			Flavor:           "cce.s1.small",
   208  			HostNetwork:      clusters.HostNetworkSpec{VpcId: "3305eb40-2707-4940-921c-9f335f84a2ca", SubnetId: "00e41db7-e56b-4946-bf91-27bb9effd664"},
   209  			ContainerNetwork: clusters.ContainerNetworkSpec{Mode: "overlay_l2"},
   210  			BillingMode:      0,
   211  			Version:          "v1.7.3-r10",
   212  		},
   213  		Status: clusters.Status{Phase: "Available", Endpoints: []clusters.Endpoints{{Url: "https://192.168.0.68:5443", Type: "Internal"}}},
   214  	},
   215  }
   216  
   217  var ListExpectedOTC = []clusters.Clusters{
   218  	{
   219  		Kind:       "Cluster",
   220  		ApiVersion: "v3",
   221  		Metadata:   clusters.MetaData{Name: "test123", Id: "daa97872-59d7-11e8-a787-0255ac101f54"},
   222  		Spec: clusters.Spec{Type: "VirtualMachine",
   223  			Flavor:           "cce.s1.small",
   224  			HostNetwork:      clusters.HostNetworkSpec{VpcId: "3305eb40-2707-4940-921c-9f335f84a2ca", SubnetId: "00e41db7-e56b-4946-bf91-27bb9effd664"},
   225  			ContainerNetwork: clusters.ContainerNetworkSpec{Mode: "overlay_l2"},
   226  			BillingMode:      0,
   227  			Version:          "v1.7.3-r10",
   228  		},
   229  		Status: clusters.Status{
   230  			Phase: "Available",
   231  			Endpoints: []clusters.Endpoints{
   232  				{Internal: "https://192.168.0.68:5443", External: "https://10.34.56.78:5443",
   233  					ExternalOTC: "https://4d1ecb2c-229a-11e8-9c75-0255ac100ceb.container.eu-de.otc.t-systems.com"},
   234  			},
   235  		},
   236  	},
   237  }