github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/networking/v2/extensions/security/groups/testing/fixtures.go (about)

     1  package testing
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/security/groups"
     5  	"github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/security/rules"
     6  )
     7  
     8  const SecurityGroupListResponse = `
     9  {
    10      "security_groups": [
    11          {
    12              "description": "default",
    13              "id": "85cc3048-abc3-43cc-89b3-377341426ac5",
    14              "name": "default",
    15              "security_group_rules": [],
    16              "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
    17          }
    18      ]
    19  }
    20  `
    21  
    22  var SecurityGroup1 = groups.SecGroup{
    23  	Description: "default",
    24  	ID:          "85cc3048-abc3-43cc-89b3-377341426ac5",
    25  	Name:        "default",
    26  	Rules:       []rules.SecGroupRule{},
    27  	TenantID:    "e4f50856753b4dc6afee5fa6b9b6c550",
    28  }
    29  
    30  const SecurityGroupCreateRequest = `
    31  {
    32      "security_group": {
    33          "name": "new-webservers",
    34          "description": "security group for webservers"
    35      }
    36  }
    37  `
    38  
    39  const SecurityGroupCreateResponse = `
    40  {
    41      "security_group": {
    42          "description": "security group for webservers",
    43          "id": "2076db17-a522-4506-91de-c6dd8e837028",
    44          "name": "new-webservers",
    45          "security_group_rules": [
    46              {
    47                  "direction": "egress",
    48                  "ethertype": "IPv4",
    49                  "id": "38ce2d8e-e8f1-48bd-83c2-d33cb9f50c3d",
    50                  "port_range_max": null,
    51                  "port_range_min": null,
    52                  "protocol": null,
    53                  "remote_group_id": null,
    54                  "remote_ip_prefix": null,
    55                  "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028",
    56                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
    57              },
    58              {
    59                  "direction": "egress",
    60                  "ethertype": "IPv6",
    61                  "id": "565b9502-12de-4ffd-91e9-68885cff6ae1",
    62                  "port_range_max": null,
    63                  "port_range_min": null,
    64                  "protocol": null,
    65                  "remote_group_id": null,
    66                  "remote_ip_prefix": null,
    67                  "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028",
    68                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
    69              }
    70          ],
    71          "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
    72      }
    73  }
    74  `
    75  
    76  const SecurityGroupUpdateRequest = `
    77  {
    78      "security_group": {
    79          "name": "newer-webservers"
    80      }
    81  }
    82  `
    83  
    84  const SecurityGroupUpdateResponse = `
    85  {
    86      "security_group": {
    87          "description": "security group for webservers",
    88          "id": "2076db17-a522-4506-91de-c6dd8e837028",
    89          "name": "newer-webservers",
    90          "security_group_rules": [
    91              {
    92                  "direction": "egress",
    93                  "ethertype": "IPv4",
    94                  "id": "38ce2d8e-e8f1-48bd-83c2-d33cb9f50c3d",
    95                  "port_range_max": null,
    96                  "port_range_min": null,
    97                  "protocol": null,
    98                  "remote_group_id": null,
    99                  "remote_ip_prefix": null,
   100                  "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028",
   101                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   102              },
   103              {
   104                  "direction": "egress",
   105                  "ethertype": "IPv6",
   106                  "id": "565b9502-12de-4ffd-91e9-68885cff6ae1",
   107                  "port_range_max": null,
   108                  "port_range_min": null,
   109                  "protocol": null,
   110                  "remote_group_id": null,
   111                  "remote_ip_prefix": null,
   112                  "security_group_id": "2076db17-a522-4506-91de-c6dd8e837028",
   113                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   114              }
   115          ],
   116          "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   117      }
   118  }
   119  `
   120  
   121  const SecurityGroupGetResponse = `
   122  {
   123      "security_group": {
   124          "description": "default",
   125          "id": "85cc3048-abc3-43cc-89b3-377341426ac5",
   126          "name": "default",
   127          "security_group_rules": [
   128              {
   129                  "direction": "egress",
   130                  "ethertype": "IPv6",
   131                  "id": "3c0e45ff-adaf-4124-b083-bf390e5482ff",
   132                  "port_range_max": null,
   133                  "port_range_min": null,
   134                  "protocol": null,
   135                  "remote_group_id": null,
   136                  "remote_ip_prefix": null,
   137                  "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
   138                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   139              },
   140              {
   141                  "direction": "egress",
   142                  "ethertype": "IPv4",
   143                  "id": "93aa42e5-80db-4581-9391-3a608bd0e448",
   144                  "port_range_max": null,
   145                  "port_range_min": null,
   146                  "protocol": null,
   147                  "remote_group_id": null,
   148                  "remote_ip_prefix": null,
   149                  "security_group_id": "85cc3048-abc3-43cc-89b3-377341426ac5",
   150                  "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   151              }
   152          ],
   153          "tenant_id": "e4f50856753b4dc6afee5fa6b9b6c550"
   154      }
   155  }
   156  `