6 #ifndef __ASN_RESERVE_FUNCTIONS_H__
7 #define __ASN_RESERVE_FUNCTIONS_H__
21 if (error_msg !=
"") {
22 printf(
"error: %s\n", error_msg.c_str());
25 printf(
"asnreserve command syntax help:\n");
28 if (specific ==
"" || specific ==
"create") {
29 printf(
" create <-o organization> <-start value> [-end value] "
30 "[-comment value]\n");
33 if (specific ==
"" || specific ==
"delete") {
34 printf(
" delete <id>\n");
38 if (error_msg !=
"") {
52 string cmd_name =
"create";
61 bool hasStart =
false;
63 bool hasOrganization =
false;
64 bool hasComment =
false;
66 while (!args.empty()) {
67 if (args[0] ==
"-start") {
75 args.erase(args.begin());
80 int start = atoi(args[0].c_str());
87 args.erase(args.begin());
88 }
else if (args[0] ==
"-end") {
96 args.erase(args.begin());
101 int end = atoi(args[0].c_str());
108 args.erase(args.begin());
109 }
else if (args[0] ==
"-o") {
111 if (hasOrganization) {
115 hasOrganization =
true;
117 args.erase(args.begin());
122 args.erase(args.begin());
123 }
else if (args[0] ==
"-comment") {
124 args.erase(args.begin());
129 string comment = args[0];
130 args.erase(args.begin());
144 if (!hasOrganization) {
152 if (hasStart && !hasEnd) {
157 printf(
"ASN Reserve to be created: [%d-%d]\n", cmd->
get_start_asn(),
162 printf(
"comment: [%s]\n", cmd->
get_comment().c_str());
180 string cmd_name =
"delete";
185 if (args.size() != 1) {
189 int id = atoi(args[0].c_str());
197 printf(
"ASN Reserve to be deleted: [%d]\n", cmd->
get_id());
215 if (!args.empty() && !(args[0] ==
"help")) {
216 if (args[0] ==
"create") {
217 args.erase(args.begin());
219 }
else if (args[0] ==
"delete") {
220 args.erase(args.begin());
230 #endif //__ASN_RESERVE_FUNCTIONS_H__
int cmd_asn_reserve_help(string error_msg, string specific="")
print asn reserve command usage info
Definition: AsnReserveFunctions.H:19
int get_start_asn() const
Returns start of the asn range.
Definition: AsnReserveCreateCmd.H:49
void set_comment(const string &comment)
Sets comment.
Definition: AsnReserveCreateCmd.H:94
EPP AsnReserveCreate Class.
Definition: AsnReserveCreateCmd.H:25
string get_organization() const
Returns organization associated with the reservation.
Definition: AsnReserveCreateCmd.H:85
int get_id() const
Returns object id.
Definition: AsnReserveDeleteCmd.H:41
void set_organization(const string &organization)
Sets organization.
Definition: AsnReserveCreateCmd.H:76
int cmd_asn_reserve_delete(vector< string > &args)
asn reserve delete function
Definition: AsnReserveFunctions.H:178
int cmd_asn_reserve(vector< string > &args)
main asn reserve command
Definition: AsnReserveFunctions.H:212
EPP AsnReserveDelete Class.
EPP AsnReserveCreate Class.
void set_id(const int id)
Sets id.
Definition: AsnReserveDeleteCmd.H:32
EPP AsnReserveDelete Class.
Definition: AsnReserveDeleteCmd.H:17
int cmd_asn_reserve_create(vector< string > &args)
asn create command function
Definition: AsnReserveFunctions.H:50
int process_action(Action &act)
Send and EPP Action.
Definition: SheppCommandFunctions.H:871
AsnReserveCreateCmd * get_command()
Returns raw pointer to the command.
Definition: AsnReserveCreate.H:54
int get_end_asn() const
Returns end of the asn range.
Definition: AsnReserveCreateCmd.H:67
string get_comment() const
Returns comment about reservation.
Definition: AsnReserveCreateCmd.H:103
void set_start_asn(const int asn)
Sets start of the asn range.
Definition: AsnReserveCreateCmd.H:40
EPP AsnReserveCreate Class.
Definition: AsnReserveCreate.H:21
EPP command-line shell client command functions include file.
static int quote_gathering(vector< string > &words, string &gather)
Gathers command-line arguments bounded by quotes in a string.
Definition: SheppStrUtil.H:152
void set_end_asn(const int asn)
Sets start of the asn range.
Definition: AsnReserveCreateCmd.H:58
AsnReserveDeleteCmd * get_command()
Returns raw pointer to the command.
Definition: AsnReserveDelete.H:53
EPP AsnReserveDelete Class.
Definition: AsnReserveDelete.H:20