(ctx context.Context, orgSlug, serviceName, serverType string, localhostPort *int)
| 217 | } |
| 218 | |
| 219 | func (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 | |
| 234 | func fetchCredentialsPath(orgSlug, realmSlug string) string { |
| 235 | return "/orgs/" + url.QueryEscape(orgSlug) + "/realms/" + url.QueryEscape(realmSlug) + "/x509/credentials" |
no test coverage detected