First commit

This commit is contained in:
Leonardo Bonati
2021-12-08 20:17:46 +00:00
commit 60dffad583
2923 changed files with 463894 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type BaseError struct {
Code int
Message string
}

View File

@@ -0,0 +1,39 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type CommandAlreadyInProgressError struct {
*BaseError
}
func NewCommandAlreadyInProgressError() *CommandAlreadyInProgressError {
return &CommandAlreadyInProgressError {
&BaseError{
Code: 405,
Message: "Command already in progress",
},
}
}
func (e *CommandAlreadyInProgressError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type E2TInstanceAbsenceError struct {
*BaseError
}
func NewE2TInstanceAbsenceError() *E2TInstanceAbsenceError {
return &E2TInstanceAbsenceError{
&BaseError{
Code: 510,
Message: "The New RAN can't be added, please try later.",
},
}
}
func (e *E2TInstanceAbsenceError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type HeaderValidationError struct {
*BaseError
}
func NewHeaderValidationError() *HeaderValidationError {
return &HeaderValidationError {
&BaseError{
Code: 415,
Message: "Header validation error",
},
}
}
func (e *HeaderValidationError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type InternalError struct {
*BaseError
}
func NewInternalError() *InternalError {
return &InternalError {
&BaseError{
Code: 501,
Message: "Internal Server Error. Please try again later",
},
}
}
func (e *InternalError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,40 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type InvalidJsonError struct {
*BaseError
}
func NewInvalidJsonError() *InvalidJsonError {
return &InvalidJsonError{
&BaseError{
Code: 401,
Message: "corrupted json",
},
}
}
func (e *InvalidJsonError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type RequestValidationError struct {
*BaseError
}
func NewRequestValidationError() *RequestValidationError {
return &RequestValidationError{
&BaseError{
Code: 402,
Message: "Validation error",
},
}
}
func (e *RequestValidationError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type ResourceNotFoundError struct {
*BaseError
}
func NewResourceNotFoundError() *ResourceNotFoundError {
return &ResourceNotFoundError{
&BaseError{
Code: 404,
Message: "Resource not found",
},
}
}
func (e *ResourceNotFoundError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type RmrError struct {
*BaseError
}
func NewRmrError() *RmrError {
return &RmrError{
&BaseError{
Code: 502,
Message: "RMR error",
},
}
}
func (e *RmrError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type RnibDbError struct {
*BaseError
}
func NewRnibDbError() *RnibDbError {
return &RnibDbError {
&BaseError{
Code: 500,
Message: "RNIB error",
},
}
}
func (e *RnibDbError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,38 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
type RoutingManagerError struct {
*BaseError
}
func NewRoutingManagerError() *RoutingManagerError {
return &RoutingManagerError{
&BaseError{
Code: 511,
Message: "No Routing Manager Available",
},
}
}
func (e *RoutingManagerError) Error() string {
return e.Message
}

View File

@@ -0,0 +1,40 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
package e2managererrors
import "fmt"
type WrongStateError struct {
*BaseError
}
func NewWrongStateError(activityName string, state string) *WrongStateError {
return &WrongStateError{
&BaseError{
Code: 403,
Message: fmt.Sprintf("Activity %s rejected. RAN current state %s does not allow its execution ", activityName, state) ,
},
}
}
func (e *WrongStateError) Error() string {
return e.Message
}