MCPcopy Create free account
hub / github.com/anchordotdev/cli / CreateService

Method CreateService

api/api.go:219–232  ·  view source on GitHub ↗
(ctx context.Context, orgSlug, serviceName, serverType string, localhostPort *int)

Source from the content-addressed store, hash-verified

217}
218
219func (s *Session) CreateService(ctx context.Context, orgSlug, serviceName, serverType string, localhostPort *int) (*Service, error) {
220 serviceInput := CreateServiceJSONRequestBody{
221 Name: serviceName,
222 ServerType: serverType,
223 LocalhostPort: localhostPort,
224 }
225 serviceInput.Relationships.Organization.Slug = orgSlug
226
227 var serviceOutput Service
228 if err := s.post(ctx, "/services", serviceInput, &serviceOutput); err != nil {
229 return nil, err
230 }
231 return &serviceOutput, nil
232}
233
234func fetchCredentialsPath(orgSlug, realmSlug string) string {
235 return "/orgs/" + url.QueryEscape(orgSlug) + "/realms/" + url.QueryEscape(realmSlug) + "/x509/credentials"

Callers 2

initialSetupMethod · 0.80

Calls 1

postMethod · 0.95

Tested by

no test coverage detected