Skip to content

Commit

Permalink
F9955 - DPCE support for BYOI imaging services (#118)
Browse files Browse the repository at this point in the history
* Include ProjectID for Project API Services object CRUD API calls.
This is needed to support DPCE GLP IAM Service creation (BYOI) at
Project scope as well (i.e. BMaaS tenant owner & contributor).

* [auto generated] Checking in generated offline HTML doc
  • Loading branch information
mchuang3 authored Jun 26, 2024
1 parent ede0358 commit 5ae3812
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 31 deletions.
4 changes: 0 additions & 4 deletions v1/api/swagger/paths/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ post:
'X-Role' and 'X-Workspaceid' headers.
Note that Hoster or BMaaS Access Owner role is required for this operation.
operationId: Service_add
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
parameters:
- $ref: ../components/parameters/SpaceID.yaml
- $ref: ../components/parameters/Space.yaml
Expand Down
8 changes: 0 additions & 8 deletions v1/api/swagger/paths/services@{serviceId}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ put:
If GreenLake Platform IAM issued token is used for authentication, then it is required to pass
'X-Role' and 'X-Workspaceid' headers.
operationId: Service_update
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
parameters:
- name: serviceId
in: path
Expand Down Expand Up @@ -90,10 +86,6 @@ delete:
If GreenLake Platform IAM issued token is used for authentication, then it is required to pass
'X-Role' and 'X-Workspaceid' headers.
operationId: Service_delete
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
parameters:
- name: serviceId
in: path
Expand Down
8 changes: 4 additions & 4 deletions v1/html/index.html

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions v1/pkg/client/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3149,10 +3149,6 @@ paths:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: internal error
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
summary: Create a new OS service image
tags:
- services
Expand Down Expand Up @@ -3209,10 +3205,6 @@ paths:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: internal error
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
summary: Delete an OS service image
tags:
- services
Expand Down Expand Up @@ -3349,10 +3341,6 @@ paths:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: internal error
security:
- BearerAuth: []
Membership: []
- BearerAuth: []
summary: Update an OS service image by its ID
tags:
- services
Expand Down
36 changes: 36 additions & 0 deletions v1/pkg/client/api_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ func (a *ServicesApiService) Add(ctx _context.Context, fileName *os.File, localV
localVarHeaderParams["Membership"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
Expand Down Expand Up @@ -266,6 +278,18 @@ func (a *ServicesApiService) Delete(ctx _context.Context, serviceId string, loca
localVarHeaderParams["Membership"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
Expand Down Expand Up @@ -729,6 +753,18 @@ func (a *ServicesApiService) Update(ctx _context.Context, serviceId string, file
localVarHeaderParams["Membership"] = key
}
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
Expand Down
6 changes: 3 additions & 3 deletions v1/pkg/client/docs/ServicesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Name | Type | Description | Notes

### Authorization

[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership)
[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership), [Project](../README.md#Project)

### HTTP request headers

Expand Down Expand Up @@ -94,7 +94,7 @@ Name | Type | Description | Notes

### Authorization

[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership)
[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership), [Project](../README.md#Project)

### HTTP request headers

Expand Down Expand Up @@ -234,7 +234,7 @@ Name | Type | Description | Notes

### Authorization

[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership)
[BearerAuth](../README.md#BearerAuth), [Membership](../README.md#Membership), [Project](../README.md#Project)

### HTTP request headers

Expand Down

0 comments on commit 5ae3812

Please sign in to comment.