1
1
/****************************************************************************\
2
2
* update_config.c - request that slurmctld update its configuration
3
* $Id: update_config.c 13672 2008-03-19 23:10:58Z jette $
3
* $Id: update_config.c 17334 2009-04-22 23:49:13Z da $
4
4
*****************************************************************************
5
* Copyright (C) 2002 The Regents of the University of California.
5
* Copyright (C) 2002-2007 The Regents of the University of California.
6
* Copyright (C) 2008-2009 Lawrence Livermore National Security.
6
7
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
8
* Written by Morris Jette <jette1@llnl.gov> and Kevin Tew <tew1@llnl.gov>.
9
* CODE-OCEC-09-009. All rights reserved.
10
11
* This file is part of SLURM, a resource management program.
11
* For details, see <http://www.llnl.gov/linux/slurm/>.
12
* For details, see <https://computing.llnl.gov/linux/slurm/>.
13
* Please also read the included file: DISCLAIMER.
13
15
* SLURM is free software; you can redistribute it and/or modify it under
14
16
* the terms of the GNU General Public License as published by the Free
16
18
* any later version.
18
20
* In addition, as a special exception, the copyright holders give permission
19
* to link the code of portions of this program with the OpenSSL library under
21
* to link the code of portions of this program with the OpenSSL library under
20
22
* certain conditions as described in each individual source file, and
21
23
* distribute linked combinations including the two. You must obey the GNU
22
24
* General Public License in all respects for all of the code used other than
81
* slurm_create_partition - create a new partition, only usable by user root
82
* IN part_msg - description of partition configuration
83
* RET 0 on success, otherwise return -1 and set errno to indicate the error
86
slurm_create_partition ( update_part_msg_t * part_msg )
88
return _slurm_update ((void *) part_msg, REQUEST_CREATE_PARTITION);
78
92
* slurm_update_partition - issue RPC to a partition's configuration per
79
93
* request, only usable by user root
80
94
* IN part_msg - description of partition updates
90
104
* slurm_delete_partition - issue RPC to delete a partition, only usable
92
* IN part_msg - description of partition updates
106
* IN part_msg - description of partition to delete
93
107
* RET 0 on success, otherwise return -1 and set errno to indicate the error
98
112
return _slurm_update ((void *) part_msg, REQUEST_DELETE_PARTITION);
116
* slurm_create_reservation - create a new reservation, only usable by user root
117
* IN resv_msg - description of reservation
118
* RET name of reservation on success (caller must free the memory),
119
* otherwise return NULL and set errno to indicate the error
122
slurm_create_reservation (resv_desc_msg_t * resv_msg )
125
char *resv_name = NULL;
127
slurm_msg_t resp_msg;
128
reservation_name_msg_t *resp;
130
slurm_msg_t_init(&req_msg);
131
slurm_msg_t_init(&resp_msg);
133
req_msg.msg_type = REQUEST_CREATE_RESERVATION;
134
req_msg.data = resv_msg;
136
rc = slurm_send_recv_controller_msg(&req_msg, &resp_msg);
137
switch (resp_msg.msg_type) {
138
case RESPONSE_CREATE_RESERVATION:
139
resp = (reservation_name_msg_t *) resp_msg.data;
140
resv_name = strdup(resp->name);
142
case RESPONSE_SLURM_RC:
143
rc = ((return_code_msg_t *) resp_msg.data)->return_code;
148
slurm_seterrno(SLURM_UNEXPECTED_MSG_ERROR);
150
slurm_free_msg_data(resp_msg.msg_type, resp_msg.data);
155
* slurm_update_reservation - modify an existing reservation, only usable by
157
* IN resv_msg - description of reservation
158
* RET 0 on success, otherwise return -1 and set errno to indicate the error
160
extern int slurm_update_reservation ( resv_desc_msg_t * resv_msg )
162
return _slurm_update ((void *) resv_msg, REQUEST_UPDATE_RESERVATION);
166
* slurm_delete_reservation - issue RPC to delete a reservation, only usable
168
* IN resv_msg - description of reservation to delete
169
* RET 0 on success, otherwise return -1 and set errno to indicate the error
172
slurm_delete_reservation ( reservation_name_msg_t * resv_msg )
174
return _slurm_update ((void *) resv_msg, REQUEST_DELETE_RESERVATION);
101
178
/* _slurm_update - issue RPC for all update requests */
103
180
_slurm_update (void *data, slurm_msg_type_t msg_type)