From 436d3f86e787c750cfc4717ded47f282d3e69a9f Mon Sep 17 00:00:00 2001 From: Attila Martin Nacsa Date: Tue, 30 Jul 2024 18:27:45 +0200 Subject: [PATCH] createJob: rename function to createArchivalJob --- datasetUtils/createJob.go | 4 ++-- datasetUtils/createJob_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/datasetUtils/createJob.go b/datasetUtils/createJob.go index 00664cd..3305f96 100644 --- a/datasetUtils/createJob.go +++ b/datasetUtils/createJob.go @@ -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. @@ -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 ! diff --git a/datasetUtils/createJob_test.go b/datasetUtils/createJob_test.go index d31ec2b..0884555 100644 --- a/datasetUtils/createJob_test.go +++ b/datasetUtils/createJob_test.go @@ -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) } @@ -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") } @@ -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") @@ -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()) }