Skip to content

Commit

Permalink
createJob: rename function to createArchivalJob
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Aug 19, 2024
1 parent c32560b commit a602c5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions datasetUtils/createJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Job struct {
}

/*
`CreateJob` creates a new job on the server. It takes in an HTTP client, the API server URL, a user map, a list of datasets, and a pointer to an integer representing the number of tape copies.
`CreateArchivalJob` creates a new job on the server. It takes in an HTTP client, the API server URL, a user map, a list of datasets, and a pointer to an integer representing the number of tape copies.
The function constructs a job map with various parameters, including the email of the job initiator, the type of job, the creation time, the job parameters, and the job status message. It also includes a list of datasets.
Expand All @@ -29,7 +29,7 @@ Parameters:
Returns:
- jobId: A string representing the job ID if the job was successfully created, or an empty string otherwise
*/
func CreateJob(client *http.Client, APIServer string, user map[string]string, datasetList []string, tapecopies *int) (jobId string, err error) {
func CreateArchivalJob(client *http.Client, APIServer string, user map[string]string, datasetList []string, tapecopies *int) (jobId string, err error) {
// important: define field with capital names and rename fields via 'json' constructs
// otherwise the marshaling will omit the fields !

Expand Down
8 changes: 4 additions & 4 deletions datasetUtils/createJob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestCreateJob(t *testing.T) {
*tapecopies = 1

// Call the function
jobId, err := CreateJob(client, APIServer, user, datasetList, tapecopies)
jobId, err := CreateArchivalJob(client, APIServer, user, datasetList, tapecopies)
if err != nil {
t.Errorf("Unexpected error received: %v", err)
}
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestCreateJob(t *testing.T) {
*tapecopies = 1

// Call the function
jobId, err := CreateJob(client, APIServer, user, datasetList, tapecopies)
jobId, err := CreateArchivalJob(client, APIServer, user, datasetList, tapecopies)
if err == nil {
t.Errorf("Expected an error to be returned from CreateJob")
}
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestCreateJob(t *testing.T) {
*tapecopies = 1

// Call the function
jobId, err := CreateJob(client, APIServer, user, datasetList, tapecopies)
jobId, err := CreateArchivalJob(client, APIServer, user, datasetList, tapecopies)

if err == nil {
t.Error("Expected an error to be returned from CreateJob")
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestCreateJob(t *testing.T) {
}

// Call the function with the mock client
jobId, err := CreateJob(client, server.URL, user, datasetList, tapecopies)
jobId, err := CreateArchivalJob(client, server.URL, user, datasetList, tapecopies)
if err != nil {
t.Errorf("Got an error when creating a job: %s", err.Error())
}
Expand Down

0 comments on commit a602c5e

Please sign in to comment.