Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

PDB-354 Deprecate old versions of commands #869

Merged
merged 1 commit into from

3 participants

@kbarber
Owner

This patch drops a warning whenever an old version of the commands API is used
and updates the documentation to warn the user these old commands are
deprecated.

Signed-off-by: Ken Barber ken@bob.sh

@kbarber kbarber PDB-354 Deprecate old versions of commands
This patch drops a warning whenever an old version of the commands API is used
and updates the documentation to warn the user these old commands are
deprecated.

Signed-off-by: Ken Barber <ken@bob.sh>
9e6beab
@senior senior merged commit 0308d53 into puppetlabs:master

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2014
  1. @kbarber

    PDB-354 Deprecate old versions of commands

    kbarber authored
    This patch drops a warning whenever an old version of the commands API is used
    and updates the documentation to warn the user these old commands are
    deprecated.
    
    Signed-off-by: Ken Barber <ken@bob.sh>
This page is out of date. Refresh to see the latest.
View
6 documentation/api/commands.markdown
@@ -70,12 +70,16 @@ processed.
### "replace catalog", version 1
+> **Note:** This version is deprecated, use the latest version instead.
+
The payload is expected to be a Puppet catalog, as a JSON string, including the
fields of the [catalog wire format][catalog]. Extra fields are
ignored.
### "replace catalog", version 2
+> **Note:** This version is deprecated, use the latest version instead.
+
The payload is expected to be a Puppet catalog, as either a JSON string or an
object, conforming exactly to the [catalog wire
format][catalog]. Extra or missing fields are an error.
@@ -103,6 +107,8 @@ effective as of the time the command is *processed*.
### "store report", version 1
+> **Note:** This version is deprecated, use the latest version instead.
+
The payload is expected to be a report, containing events that occurred on Puppet
resources. It is structured as a JSON object, conforming to the
[report wire format][report].
View
3  src/com/puppetlabs/puppetdb/command.clj
@@ -321,6 +321,7 @@
(defmethod process-command! [(command-names :replace-catalog) 1]
[{:keys [version payload] :as command} options]
{:pre [(= version 1)]}
+ (log/warn "command 'replace catalog' version 1 is deprecated, use the latest version")
(when-not (string? payload)
(throw (IllegalArgumentException.
(format "Payload for a '%s' v1 command must be a JSON string."
@@ -330,6 +331,7 @@
(defmethod process-command! [(command-names :replace-catalog) 2]
[{:keys [version] :as command} options]
{:pre [(= version 2)]}
+ (log/warn "command 'replace catalog' version 2 is deprecated, use the latest version")
(replace-catalog* command options))
(defmethod process-command! [(command-names :replace-catalog) 3]
@@ -381,6 +383,7 @@
(defmethod process-command! [(command-names :store-report) 1]
[{:keys [version] :as command} {:keys [db]}]
{:pre [(= version 1)]}
+ (log/warn "command 'store report' version 1 is deprecated, use the latest version")
(store-report* 1 db command))
(defmethod process-command! [(command-names :store-report) 2]
Something went wrong with that request. Please try again.