appmanager: with web interface to upload chart archives
diff --git a/appmanager/installer.go b/appmanager/installer.go
new file mode 100644
index 0000000..1fc5ae8
--- /dev/null
+++ b/appmanager/installer.go
@@ -0,0 +1,21 @@
+package appmanager
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+)
+
+func InstallSchema(schema *Schema, apiAddr string) error {
+ if schema == nil || len(schema.Schema) == 0 {
+ return nil
+ }
+ resp, err := http.Post(apiAddr, "application/text", strings.NewReader(schema.Schema))
+ if err != nil {
+ return err
+ }
+ if resp.StatusCode != http.StatusOK {
+ return fmt.Errorf("Failed request with status code: %d", resp.StatusCode)
+ }
+ return nil
+}