(domainName string, owningOrgGUID string)
| 111 | } |
| 112 | |
| 113 | func (repo CloudControllerDomainRepository) Create(domainName string, owningOrgGUID string) (createdDomain models.DomainFields, err error) { |
| 114 | data, err := json.Marshal(resources.DomainEntity{ |
| 115 | Name: domainName, |
| 116 | OwningOrganizationGUID: owningOrgGUID, |
| 117 | Wildcard: true, |
| 118 | }) |
| 119 | |
| 120 | if err != nil { |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | resource := new(resources.DomainResource) |
| 125 | err = repo.gateway.CreateResource( |
| 126 | repo.config.APIEndpoint(), |
| 127 | "/v2/private_domains", |
| 128 | bytes.NewReader(data), |
| 129 | resource) |
| 130 | |
| 131 | if err != nil { |
| 132 | return |
| 133 | } |
| 134 | |
| 135 | createdDomain = resource.ToFields() |
| 136 | return |
| 137 | } |
| 138 | |
| 139 | func (repo CloudControllerDomainRepository) CreateSharedDomain(domainName string, routerGroupGUID string) error { |
| 140 | data, err := json.Marshal(resources.DomainEntity{ |
nothing calls this directly
no test coverage detected