>From cb227b68f123243eed844dc63f90e9bb9c24e7f7 Mon Sep 17 00:00:00 2001
From: Abhishek Koneru <akoneru@redhat.com>
Date: Tue, 30 Sep 2014 14:48:00 -0400
Subject: [PATCH] Add a man page for profile CLI commands.

---
 base/java-tools/man/man1/pki-profile.1 | 133 +++++++++++++++++++++++++++++++++
 base/java-tools/man/man1/pki.1         |   6 ++
 specs/pki-core.spec                    |   1 +
 3 files changed, 140 insertions(+)
 create mode 100644 base/java-tools/man/man1/pki-profile.1

diff --git a/base/java-tools/man/man1/pki-profile.1 b/base/java-tools/man/man1/pki-profile.1
new file mode 100644
index 0000000000000000000000000000000000000000..9534b633b5205b9d43f00c11e6c1966c35f23c9e
--- /dev/null
+++ b/base/java-tools/man/man1/pki-profile.1
@@ -0,0 +1,133 @@
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH pki-profile 1 "Sep 30, 2014" "version 10.2" "PKI Profile Management Commands" Dogtag Team
+.\" Please adjust this date whenever revising the man page.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for man page specific macros, see man(7)
+.SH NAME
+pki-profile \- Command-Line Interface for managing profiles in the Certificate System.
+
+.SH SYNOPSIS
+.nf
+\fBpki\fR [CLI options] \fB<subsystem>-profile\fR
+\fBpki\fR [CLI options] \fB<subsystem>-profile-find\fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-show <Profile ID> \fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-add <Input file path> \fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-mod <Input file path> \fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-del <Profile ID> \fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-enable <Profile ID> \fR [command options]
+\fBpki\fR [CLI options] \fB<subsystem>-profile-disable <Profile ID> \fR  [command options]
+.fi
+
+.SH DESCRIPTION
+.PP
+The \fBpki-profile\fR commands provide command-line interfaces to manage profiles on the CA.
+.PP
+The only valid subsystem is \fBca\fR. The \fBca-\fR prefix may be omitted.
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-find\fR [command options]
+.RS 4
+This command is to list the profiles.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-show <Profile ID>\fR [command options]
+.RS 4
+This command is to get a profile.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-add\fR <Input file path> [command options]
+.RS 4
+This command is to create a new profile in the CA.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-mod <Input file path> \fR [command options]
+.RS 4
+This command is to modify an existing profile in the CA.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-del\fR <Profile ID> [command options]
+.RS 4
+This command is to delete a profile in the CA.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-enable\fR <Profile ID> [command options]
+.RS 4
+This command is to enable a profile.
+.RE
+.PP
+\fBpki\fR [CLI options] \fB<subsystem>-profile-disable\fR <Profile ID> [command options]
+.RS 4
+This command is to disable a profile.
+.RE
+.SH OPTIONS
+The CLI options are described in \fBpki\fR(1).
+
+.SH OPERATIONS
+
+To view available profile commands, type \fBpki ca-profile\fP. To view each command's usage, type \fB pki ca-profile-<command> \-\-help\fP.
+
+All the ca-profile commands require agent authentication.
+
+.SS Viewing the profiles
+
+.B pki <agent authentication> profile-find
+
+The options start and stop can be used to specify the beginning and the size of the list.
+
+To view the contents of a profile:
+
+.B pki <agent authentication> profile-show <Profile ID>
+
+To store the output of the above operation, the output option must be specified.
+
+.B pki <agent authentication> profile-show <Profile ID> --output <FILE_PATH>
+
+This output file can be filled with data and used for certificate enrollment.
+
+.SS Add/Modify/Delete a profile
+
+.B pki <agent authentication> profile-add <Input file path>
+
+The contents of the input file must be in an XML format returned by the profile-show command.
+This data will be marshaled by the CLI client to create a new profile in the CA.
+
+To modify an existing profile:
+
+.B pki <agent authentication> profile-mod <Input file path>
+
+The profile data can be retrieved using the profile-show command and after editing the file,
+it can be provided to the profile-mod command to modify an existing profile.
+
+To delete a profile in the CA:
+
+.B pki <agent authentication> profile-delete <Profile ID>
+
+.SS Enabling/Disabling a profile in the CA
+
+To enable a profile in the CA:
+
+.B pki <agent authenticaton> profile-enable <Profile ID>
+
+To disable a profile in the CA:
+
+.B pki <agent authentication> profile-disable <Profile ID>
+
+.SH AUTHORS
+Abhishek Koneru <akoneru@redhat.com>.
+
+.SH COPYRIGHT
+Copyright (c) 2014 Red Hat, Inc. This is licensed under the GNU General Public License, version 2 (GPLv2). A copy of this license is available at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+
+.SH SEE ALSO
+.BR pkispawn(8),
+.BR pki(1)
diff --git a/base/java-tools/man/man1/pki.1 b/base/java-tools/man/man1/pki.1
index 8e6af9fab72794116cc49466ee222f372b0e1afa..9f895fa4e1b11674142b065a1797d87c7b999e28 100644
--- a/base/java-tools/man/man1/pki.1
+++ b/base/java-tools/man/man1/pki.1
@@ -260,6 +260,12 @@ Security domain management commands
 User management commands
 .RE
 
+.PP
+\fBpki-profile\fR(1)
+.RS 4
+User management commands
+.RE
+
 .SH AUTHORS
 Ade Lee <alee@redhat.com>, Endi Dewata <edewata@redhat.com>, and Matthew Harmsen <mharmsen@redhat.com>.
 
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index a7bec33308a292c5b85fd788fb7c936bccb35a59..21ac868ef11d1371a50272bbe9bb72a7a3a26046 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -733,6 +733,7 @@ echo >> /var/log/pki/pki-server-upgrade-%{version}.log 2>&1
 %{_mandir}/man1/pki-key.1.gz
 %{_mandir}/man1/pki-securitydomain.1.gz
 %{_mandir}/man1/pki-user.1.gz
+%{_mandir}/man1/pki-profile.1.gz
 
 
 %if %{with server}
-- 
1.8.5.3

