MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Create

Method Create

cf/api/domains.go:113–137  ·  view source on GitHub ↗
(domainName string, owningOrgGUID string)

Source from the content-addressed store, hash-verified

111}
112
113func (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
139func (repo CloudControllerDomainRepository) CreateSharedDomain(domainName string, routerGroupGUID string) error {
140 data, err := json.Marshal(resources.DomainEntity{

Callers

nothing calls this directly

Calls 3

CreateResourceMethod · 0.80
APIEndpointMethod · 0.65
ToFieldsMethod · 0.65

Tested by

no test coverage detected