libdeltacloud 0.9
include/libdeltacloud/loadbalancer.h
00001 /*
00002  * Copyright (C) 2011 Red Hat, Inc.
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00017  *
00018  * Author: Chris Lalancette <clalance@redhat.com>
00019  */
00020 
00021 #ifndef LIBDELTACLOUD_LOADBALANCER_H
00022 #define LIBDELTACLOUD_LOADBALANCER_H
00023 
00024 #include "action.h"
00025 #include "address.h"
00026 #include "link.h"
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00037 struct deltacloud_loadbalancer_listener {
00038   char *protocol; 
00039   char *load_balancer_port; 
00040   char *instance_port; 
00042   struct deltacloud_loadbalancer_listener *next;
00043 };
00044 
00048 struct deltacloud_loadbalancer_instance {
00049   char *href; 
00050   char *id; 
00051   struct deltacloud_link *links; 
00053   struct deltacloud_loadbalancer_instance *next;
00054 };
00055 
00059 struct deltacloud_loadbalancer {
00060   char *href; 
00061   char *id; 
00062   struct deltacloud_action *actions; 
00063   struct deltacloud_address *public_addresses; 
00064   char *created_at; 
00065   char *realm_href; 
00066   char *realm_id; 
00067   struct deltacloud_loadbalancer_listener *listeners; 
00068   struct deltacloud_loadbalancer_instance *instances; 
00070   struct deltacloud_loadbalancer *next;
00071 };
00072 
00073 #define deltacloud_supports_loadbalancers(api) deltacloud_has_link(api, "load_balancers")
00074 int deltacloud_get_loadbalancers(struct deltacloud_api *api,
00075                                  struct deltacloud_loadbalancer **balancers);
00076 int deltacloud_get_loadbalancer_by_id(struct deltacloud_api *api,
00077                                       const char *id,
00078                                       struct deltacloud_loadbalancer *balancer);
00079 int deltacloud_create_loadbalancer(struct deltacloud_api *api, const char *name,
00080                                    const char *realm_id, const char *protocol,
00081                                    int balancer_port, int instance_port,
00082                                    struct deltacloud_create_parameter *params,
00083                                    int params_length);
00084 int deltacloud_loadbalancer_register(struct deltacloud_api *api,
00085                                      struct deltacloud_loadbalancer *balancer,
00086                                      const char *instance_id,
00087                                      struct deltacloud_create_parameter *params,
00088                                      int params_length);
00089 int deltacloud_loadbalancer_unregister(struct deltacloud_api *api,
00090                                        struct deltacloud_loadbalancer *balancer,
00091                                        const char *instance_id,
00092                                        struct deltacloud_create_parameter *params,
00093                                        int params_length);
00094 int deltacloud_loadbalancer_destroy(struct deltacloud_api *api,
00095                                     struct deltacloud_loadbalancer *balancer);
00096 void deltacloud_free_loadbalancer(struct deltacloud_loadbalancer *lb);
00097 void deltacloud_free_loadbalancer_list(struct deltacloud_loadbalancer **lbs);
00098 
00099 #ifdef __cplusplus
00100 }
00101 #endif
00102 
00103 #endif
 All Data Structures Files Functions Variables