Skip to content

Commit

Permalink
MEDIUM: remove defaults and rename named_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurand0710 committed Feb 16, 2024
1 parent fe640f8 commit 63319b0
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 425 deletions.
58 changes: 2 additions & 56 deletions specification/build/haproxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11228,60 +11228,6 @@ paths:
tags:
- Global
/services/haproxy/configuration/defaults:
get:
deprecated: true
description: Returns defaults part of configuration, this has been deprecated, use named_defaults instead.
operationId: getDefaults
parameters:
- $ref: '#/parameters/transaction_id'
responses:
"200":
description: Successful operation
headers:
Configuration-Version:
description: Configuration file version
type: string
schema:
$ref: '#/definitions/defaults'
default:
$ref: '#/responses/DefaultError'
summary: Return defaults part of configuration
tags:
- Defaults
put:
deprecated: true
description: Replace defaults part of config, this has been deprecated, use named_defaults instead.
operationId: replaceDefaults
parameters:
- in: body
name: data
required: true
schema:
$ref: '#/definitions/defaults'
- $ref: '#/parameters/transaction_id'
- $ref: '#/parameters/version'
- $ref: '#/parameters/force_reload'
responses:
"200":
description: Defaults replaced
schema:
$ref: '#/definitions/defaults'
"202":
description: Configuration change accepted and reload requested
headers:
Reload-ID:
description: ID of the requested reload
type: string
schema:
$ref: '#/definitions/defaults'
"400":
$ref: '#/responses/BadRequest'
default:
$ref: '#/responses/DefaultError'
summary: Replace defaults
tags:
- Defaults
/services/haproxy/configuration/named_defaults:
get:
description: Returns an array of all configured defaults.
operationId: getDefaultsSections
Expand All @@ -11301,7 +11247,7 @@ paths:
summary: Return an array of defaults
tags:
- Defaults
post:
put:
description: Adds a new defaults section to the configuration file.
operationId: createDefaultsSection
parameters:
Expand Down Expand Up @@ -11335,7 +11281,7 @@ paths:
summary: Add a defaults section
tags:
- Defaults
/services/haproxy/configuration/named_defaults/{name}:
/services/haproxy/configuration/defaults/{name}:
delete:
description: Deletes a defaults section from the configuration by it's name.
operationId: deleteDefaultsSection
Expand Down
6 changes: 2 additions & 4 deletions specification/haproxy-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,8 @@ paths:
$ref: "paths/configuration/global.yaml#/global"
/services/haproxy/configuration/defaults:
$ref: "paths/configuration/defaults.yaml#/defaults"
/services/haproxy/configuration/named_defaults:
$ref: "paths/configuration/named_defaults.yaml#/defaults"
/services/haproxy/configuration/named_defaults/{name}:
$ref: "paths/configuration/named_defaults.yaml#/defaults_one"
/services/haproxy/configuration/defaults/{name}:
$ref: "paths/configuration/defaults.yaml#/defaults_one"
/services/haproxy/configuration/frontends:
$ref: "paths/configuration/frontend.yaml#/frontends"
/services/haproxy/configuration/frontends/{name}:
Expand Down
114 changes: 104 additions & 10 deletions specification/paths/configuration/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
defaults:
get:
deprecated: true
summary: Return defaults part of configuration
description: Returns defaults part of configuration, this has been deprecated, use named_defaults instead.
operationId: getDefaults
summary: Return an array of defaults
description: Returns an array of all configured defaults.
operationId: getDefaultsSections
parameters:
- $ref: "#/parameters/transaction_id"
tags:
Expand All @@ -17,14 +16,13 @@ defaults:
description: Configuration file version
type: string
schema:
$ref: "#/definitions/defaults"
$ref: "#/definitions/defaults_sections"
'default':
$ref: '#/responses/DefaultError'
put:
deprecated: true
summary: Replace defaults
description: Replace defaults part of config, this has been deprecated, use named_defaults instead.
operationId: replaceDefaults
summary: Add a defaults section
description: Adds a new defaults section to the configuration file.
operationId: createDefaultsSection
parameters:
- name: data
required: true
Expand All @@ -36,6 +34,72 @@ defaults:
- $ref: "#/parameters/force_reload"
tags:
- Defaults
responses:
'202':
description: Configuration change accepted and reload requested
headers:
Reload-ID:
description: ID of the requested reload
type: string
schema:
$ref: "#/definitions/defaults"
'201':
description: Defaults created
schema:
$ref: "#/definitions/defaults"
'409':
$ref: '#/responses/AlreadyExists'
'400':
$ref: '#/responses/BadRequest'
'default':
$ref: '#/responses/DefaultError'
defaults_one:
get:
summary: Return a defaults section
description: Returns one defaults section configuration by it's name.
operationId: getDefaultsSection
tags:
- Defaults
parameters:
- name: name
in: path
description: Defaults name
required: true
type: string
- $ref: "#/parameters/transaction_id"
responses:
'200':
description: Successful operation
headers:
Configuration-Version:
description: Configuration file version
type: string
schema:
$ref: "#/definitions/defaults"
'404':
$ref: '#/responses/NotFound'
'default':
$ref: '#/responses/DefaultError'
put:
summary: Replace a defatults section
description: Replaces a defatults section configuration by it's name.
operationId: replaceDefaultsSection
tags:
- Defaults
parameters:
- name: name
in: path
description: Defaults name
required: true
type: string
- name: data
required: true
in: body
schema:
$ref: "#/definitions/defaults"
- $ref: "#/parameters/transaction_id"
- $ref: "#/parameters/version"
- $ref: "#/parameters/force_reload"
responses:
'202':
description: Configuration change accepted and reload requested
Expand All @@ -46,10 +110,40 @@ defaults:
schema:
$ref: "#/definitions/defaults"
'200':
description: Defaults replaced
description: Defaults section replaced
schema:
$ref: "#/definitions/defaults"
'400':
$ref: '#/responses/BadRequest'
'404':
$ref: '#/responses/NotFound'
'default':
$ref: '#/responses/DefaultError'
delete:
summary: Delete a defaults section
description: Deletes a defaults section from the configuration by it's name.
operationId: deleteDefaultsSection
tags:
- Defaults
parameters:
- name: name
in: path
description: Defaults name
required: true
type: string
- $ref: "#/parameters/transaction_id"
- $ref: "#/parameters/version"
- $ref: "#/parameters/force_reload"
responses:
'202':
description: Configuration change accepted and reload requested
headers:
Reload-ID:
description: ID of the requested reload
type: string
'204':
description: Defaults section deleted
'404':
$ref: '#/responses/NotFound'
'default':
$ref: '#/responses/DefaultError'
149 changes: 0 additions & 149 deletions specification/paths/configuration/named_defaults.yaml

This file was deleted.

Loading

0 comments on commit 63319b0

Please sign in to comment.