-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add registration API between origin and director
This work-in-progress commit sketches out a new REST API for the origin to register itself (and its available namespaces) with the director. The bones on the server side are there; the invocation from the origin (and the generation of the data at the origin) are not.
- Loading branch information
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package origin_ui | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/pelicanplatform/pelican/director" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
func AdvertiseOrigin() error { | ||
name := viper.GetString("Sitename") | ||
if name == "" { | ||
return errors.New("Origin name isn't set") | ||
} | ||
// TODO: waiting on a different branch to merge origin URL generation | ||
url := "https://localhost:8444" | ||
|
||
ad := director.OriginAdvertise{ | ||
Name: name, | ||
URL: url, | ||
Namespaces: make([]director.NamespaceAd, 0), | ||
} | ||
_ = ad | ||
return nil | ||
} |